Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
serverbrowserfavoritestabpc.c
Go to the documentation of this file.
1
class
ServerBrowserFavoritesTabPc
extends
ServerBrowserTabPc
2
{
3
// value = ip, name, connection port, query port
4
private
ref
array<ref CachedServerInfo>
m_CachedFavoriteServerInfo
;
5
6
protected
override
void
Construct
(
Widget
parent, ServerBrowserMenuNew menu,
TabType
type)
7
{
8
m_CachedFavoriteServerInfo
=
new
array<ref CachedServerInfo>
();
9
10
super.Construct(parent, menu, type);
11
}
12
13
protected
override
void
LoadExtraEntries
(
int
index)
14
{
15
array<ref Param2<string, CachedServerInfo>
> relevantCachedInfo =
new
array<ref Param2<string, CachedServerInfo>
>();
16
foreach
(
CachedServerInfo
cachedInfo :
m_CachedFavoriteServerInfo
)
17
{
18
string
serverId =
GetConnEndPoint
(cachedInfo);
19
20
// ensure the cached server is still favorited
21
if
(!
m_Menu
.IsFavorited(
GetQueryEndPoint
(cachedInfo)))
22
{
23
continue
;
24
}
25
26
if
(
m_OnlineFavServers
.Find(serverId) > -1)
27
{
28
continue
;
29
}
30
31
relevantCachedInfo.Insert(
new
Param2<string, CachedServerInfo>
(serverId, cachedInfo));
32
}
33
34
// adding FAVORITED, OFFLINE servers to favorites tab
35
int
totalServersAlreadyShown =
m_PageIndex
* SERVERS_VISIBLE_COUNT + index;
36
int
startingIndex = totalServersAlreadyShown -
m_TotalLoadedServers
;
37
m_TotalLoadedServers
+= relevantCachedInfo.Count();
38
for
(
int
i = startingIndex; i < relevantCachedInfo.Count(); ++i)
39
{
40
if
(index >= SERVERS_VISIBLE_COUNT)
41
{
42
break
;
43
}
44
45
Param2<string, CachedServerInfo>
relevantEntry = relevantCachedInfo[i];
46
47
cachedInfo = relevantEntry.param2;
48
string
ip = cachedInfo.param1;
49
string
cachedName = cachedInfo.param2;
50
int
connPort = cachedInfo.param3;
51
int
queryPort = cachedInfo.param4;
52
53
// do NOT insert offlineRow into m_EntriesSorted[m_SortType]!!
54
// we assume that rows already in m_EntriesSorted[m_SortType] are ONLINE,
55
// if we add offline info to m_EntriesSorted[m_SortType] then we cannot differentiate
56
// between online and offline servers
57
GetServersResultRow
offlineRow =
new
GetServersResultRow
();
58
offlineRow.
m_Id
= relevantEntry.param1;
59
offlineRow.
m_Name
= cachedName;
60
offlineRow.
m_HostIp
= ip;
61
offlineRow.
m_SteamQueryPort
= queryPort;
62
offlineRow.
m_HostPort
= connPort;
63
offlineRow.
m_Favorite
=
true
;
64
offlineRow.
m_IsSelected
= (offlineRow.
GetIpPort
() ==
m_CurrentSelectedServer
);
65
66
ServerBrowserEntry entry = GetServerEntryByIndex(index, offlineRow.
GetIpPort
());
67
entry.Show(
true
);
68
entry.SetIsOnline(
false
);
69
entry.FillInfo(offlineRow);
70
entry.UpdateEntry();
71
72
index++;
73
}
74
}
75
76
override
void
RefreshList
()
77
{
78
OnlineServices
.
GetCachedFavServerInfo
(
m_CachedFavoriteServerInfo
);
79
80
m_OnlineFavServers
.Clear();
81
super.RefreshList();
82
83
m_CurrentFilterInput
.SetFavorited(
true
);
84
AddFavoritesToFilter
(
m_CurrentFilterInput
);
85
OnlineServices
.
LoadServers
(
m_CurrentFilterInput
);
86
}
87
88
private
string
GetConnEndPoint
(
CachedServerInfo
cachedInfo)
89
{
90
string
ip = cachedInfo.param1;
91
int
connPort = cachedInfo.param3;
92
return
ip +
":"
+ connPort;
93
}
94
95
private
string
GetQueryEndPoint
(
CachedServerInfo
cachedInfo)
96
{
97
string
ip = cachedInfo.param1;
98
int
queryPort = cachedInfo.param4;
99
return
ip +
":"
+ queryPort;
100
}
101
}
m_PageIndex
int m_PageIndex
Definition
uihintpanel.c:315
CachedServerInfo
Param4< string, string, int, int > CachedServerInfo
Definition
bioslobbyservice.c:2
GetServersResultRow
GetServersResultRow the output structure of the GetServers operation that represents one game server.
Definition
bioslobbyservice.c:170
GetServersResultRow::GetIpPort
string GetIpPort()
Definition
bioslobbyservice.c:221
GetServersResultRow::m_Id
string m_Id
Definition
bioslobbyservice.c:171
GetServersResultRow::m_Name
string m_Name
Definition
bioslobbyservice.c:173
GetServersResultRow::m_Favorite
bool m_Favorite
Definition
bioslobbyservice.c:219
GetServersResultRow::m_IsSelected
bool m_IsSelected
Definition
bioslobbyservice.c:201
GetServersResultRow::m_HostPort
int m_HostPort
Definition
bioslobbyservice.c:176
GetServersResultRow::m_SteamQueryPort
int m_SteamQueryPort
Definition
bioslobbyservice.c:217
GetServersResultRow::m_HostIp
string m_HostIp
Definition
bioslobbyservice.c:175
OnlineServices
Definition
onlineservices.c:2
OnlineServices::GetCachedFavServerInfo
static void GetCachedFavServerInfo(array< ref CachedServerInfo > favServersInfoCache)
Definition
onlineservices.c:114
OnlineServices::LoadServers
static void LoadServers(notnull GetServersInput inputValues)
Definition
onlineservices.c:96
Param2
Definition
ppeconstants.c:68
ServerBrowserTabPc
Definition
serverbrowserfavoritestabpc.c:2
ServerBrowserTabPc::GetQueryEndPoint
string GetQueryEndPoint(CachedServerInfo cachedInfo)
Definition
serverbrowserfavoritestabpc.c:95
ServerBrowserTabPc::LoadExtraEntries
override void LoadExtraEntries(int index)
Definition
serverbrowserfavoritestabpc.c:13
ServerBrowserTabPc::RefreshList
override void RefreshList()
Definition
serverbrowserfavoritestabpc.c:76
ServerBrowserTabPc::GetConnEndPoint
string GetConnEndPoint(CachedServerInfo cachedInfo)
Definition
serverbrowserfavoritestabpc.c:88
ServerBrowserTabPc::Construct
override void Construct(Widget parent, ServerBrowserMenuNew menu, TabType type)
Definition
serverbrowserfavoritestabpc.c:6
ServerBrowserTabPc::m_CachedFavoriteServerInfo
ref array< ref CachedServerInfo > m_CachedFavoriteServerInfo
Definition
serverbrowserfavoritestabpc.c:4
Widget
Definition
enwidgets.c:190
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
m_CurrentFilterInput
ref GetServersInput m_CurrentFilterInput
Definition
serverbrowsertab.c:57
TabType
TabType
Definition
serverbrowsertab.c:2
m_TotalLoadedServers
int m_TotalLoadedServers
Definition
serverbrowsertab.c:49
m_CurrentSelectedServer
string m_CurrentSelectedServer
Definition
serverbrowsertab.c:55
m_Menu
ServerBrowserMenuNew m_Menu
Definition
serverbrowsertab.c:37
AddFavoritesToFilter
void AddFavoritesToFilter(GetServersInput input)
Definition
serverbrowsertab.c:452
m_OnlineFavServers
ref set< string > m_OnlineFavServers
Definition
serverbrowsertab.c:77
Games
Dayz
scripts
5_mission
gui
newui
serverbrowsermenu
serverbrowserfavoritestabpc.c
Generated by
1.17.0