18enum ServerBrowserRightAreaView
35 protected ref ServerBrowserFilterContainer
m_Filters;
37 protected ServerBrowserMenuNew
m_Menu;
87 protected ref ServerBrowserDetailsContainer
m_Details;
91 protected static bool m_DummyServersEnabled;
117 if (
g_Game.GetContentDLCService())
120 #ifdef DIAG_DEVELOPER
138 foreach (ServerBrowserEntry entry : serverEntries)
140 entry.RefreshDLCIcon();
152 Widget root = entry.GetRoot();
153 Widget first_child = root.GetParent().GetChildren();
154 Widget last_child = first_child;
157 if ( last_child.GetSibling() )
158 last_child = last_child.GetSibling();
163 root.GetParent().Update();
169 float bottom_pos =
y + y_s;
171 root.GetScreenPos( x_l, y_l );
172 root.GetScreenSize( x_s, y_s );
174 if ( root == first_child )
178 else if ( root == last_child )
182 else if ( y_l + y_s >= bottom_pos )
207 m_Menu.FilterFocus(
false);
219 m_Menu.DetailsFocus(
false);
225 m_Menu.DetailsFocus(
true);
235 m_Menu.ServerListFocus(focus, favorite);
252 #ifdef PLATFORM_CONSOLE
257 aButtonLabel =
"#ps4_ingame_menu_select";
259 aButtonLabel =
"#layout_xbox_ingame_menu_select";
261 m_Menu.UpdateAButtonLabel(aButtonLabel);
265 aButtonLabel =
"#dialog_change";
266 m_Menu.UpdateAButtonLabel(aButtonLabel);
270 m_Menu.ShowAButton(
false);
373 Widget sibling = focused.GetSibling();
377 if ( focused.GetName() ==
"server_browser_list_entry_root" )
382 SetFocus( focused.GetParent().GetSibling().GetChildren() );
389 if ( focused && focused.GetName() ==
"server_browser_list_entry_root" )
391 Widget sibling = focused.GetParent().GetChildren();
392 if ( focused == sibling )
397 if ( sibling && sibling.GetSibling() == focused )
403 sibling = sibling.GetSibling();
439 m_Menu.AddFavoritesToFilter( input );
455 m_Menu.DeselectCurrentServer();
459 #ifndef PLATFORM_WINDOWS
466 #ifdef PLATFORM_CONSOLE
508 #ifdef PLATFORM_CONSOLE
519 m_Menu.SelectServer(server);
590 return "currentNumberPlayers";
611 ServerBrowserEntry entry;
614 entry.SetFavorite(
false);
644 if ( w.IsInherited( ButtonWidget ) )
646 ButtonWidget button = ButtonWidget.Cast( w );
647 button.SetTextColor(
ARGB( 255, 200, 0, 0 ) );
650 w.SetColor(
ARGB( 255, 0, 0, 0) );
655 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
656 Widget option =
Widget.Cast( w.FindAnyWidget( w.GetName() +
"_option_wrapper" ) );
657 Widget option_label = w.FindAnyWidget(
"option_label" );
661 text1.SetColor(
ARGB( 255, 255, 0, 0 ) );
666 text2.SetColor(
ARGB( 255, 255, 0, 0 ) );
671 text3.SetColor(
ARGB( 255, 255, 0, 0 ) );
677 image.SetColor(
ARGB( 255, 200, 0, 0 ) );
682 option.SetColor(
ARGB( 255, 255, 0, 0 ) );
687 option_label.SetColor(
ARGB( 255, 255, 0, 0 ) );
698 if ( w.IsInherited( ButtonWidget ) )
700 ButtonWidget button = ButtonWidget.Cast( w );
701 button.SetTextColor(
ARGB( 255, 255, 255, 255 ) );
707 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
708 Widget option = w.FindAnyWidget( w.GetName() +
"_option_wrapper" );
709 Widget option_label = w.FindAnyWidget(
"option_label" );
713 text1.SetColor(
ARGB( 255, 255, 255, 255 ) );
718 text2.SetColor(
ARGB( 255, 255, 255, 255 ) );
723 text3.SetColor(
ARGB( 255, 255, 255, 255 ) );
729 image.SetColor(
ARGB( 255, 255, 255, 255 ) );
734 option.SetColor(
ARGB( 150, 255, 255, 255 ) );
739 option_label.SetColor(
ARGB( 255, 255, 255, 255 ) );
745 #ifdef PLATFORM_WINDOWS
751 ButtonWidget button = ButtonWidget.Cast( w );
763 case SelectedPanel.BROWSER:
775 case SelectedPanel.DETAILS:
780 case SelectedPanel.FILTERS:
794 m_Details.SetDetails(server_info, online);
821 protected void InitDummyServers()
823 m_DummyServersEnabled = DiagMenu.GetBool(
DiagMenuIDs.SERVER_BROWSER_DUMMY_SERVERS);
824 PluginDiagMenuClient.GetSBDummyServersInvoker().Insert(OnDummyServersEnabledChanged);
826 m_DummyServers =
new GetServersResult();
827 m_DummyServers.m_NumServers = 100;
829 int serversVisibleCount = GetServersVisibleCount();
830 m_DummyServers.m_Pages = (m_DummyServers.m_NumServers + serversVisibleCount - 1) / serversVisibleCount;
831 if (m_DummyServers.m_Pages < 1)
833 m_DummyServers.m_Pages = 1;
835 m_DummyServers.m_Page = 1;
838 TStringArray mapNames = {
"chernarusplus",
"enoch",
"sakhal"};
839 for (
int i = 0; i < m_DummyServers.m_NumServers; ++i)
841 GetServersResultRow row =
new GetServersResultRow();
843 string fakeIP =
"127.0.0." + ((i % 250) + 1).
ToString();
844 int fakePort = 2302 + (i % 10);
845 row.
m_Name =
string.
Format(
"[TEST] Dummy Server %1", i + 1);
847 #ifdef PLATFORM_CONSOLE
852 row.
m_Description =
string.
Format(
"Dummy server %1 description. Do not favorite me!", i + 1);
857 row.
m_Ping = 20 + (i % 180);
860 m_DummyServers.m_Results.
Insert(row);
864 protected void OnDummyServersEnabledChanged()
866 m_DummyServersEnabled = DiagMenu.GetBool(
DiagMenuIDs.SERVER_BROWSER_DUMMY_SERVERS);
873 protected int GetServersVisibleCount()
878 protected bool PassLocalFilters(GetServersResultRow result)
892 string searchName =
m_Filters.GetSearchByNameFilterText();
893 if (searchName !=
"")
895 string serverName = result.
m_Name;
898 if (serverName.
IndexOf(searchName) == -1)
905 #ifdef PLATFORM_WINDOWS
906 string searchIP =
m_Filters.GetSearchByIPFilterText();
915 if (hostIp.
IndexOf(searchIP) == -1 && ipPort.
IndexOf(searchIP) == -1)
923 string mapFilter =
m_Filters.GetMapFilterInternalName();
929 if (serverMap != mapFilter)
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
array< ref GetServersResultRow > GetServersResultRowArray
void LoadExtraEntries(int index)
void ServerBrowserTab(Widget parent, ServerBrowserMenuNew menu, TabType type)
ref ServerBrowserFilterContainer m_Filters
ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
void OnDetailsFocusLost(Widget w)
Widget m_FilterSearchText
void SelectServer(ServerBrowserEntry server)
TextWidget m_RightAreaHeaderText
ServerBrowserEntry m_SelectedServer
void ButtonDisable(Widget w)
ref GetServersInput m_CurrentFilterInput
void SwitchRightAreaView()
void ServerListFocus(bool focus, bool favorite)
ButtonWidget m_BtnPageNext
ref map< ESortType, ESortOrder > m_SortInverted
bool IsPingInRange(int ping, string max_ping)
ButtonWidget m_BtnShowFilters
ref map< string, ref ServerBrowserEntry > m_EntryWidgets
bool GetIsServerLoadingFinished()
void ScrollToEntry(ServerBrowserEntry entry)
void Connect(ServerBrowserEntry server)
ScrollWidget m_ServerListScroller
string m_CurrentSelectedServer
ServerBrowserMenuNew m_Menu
ref map< string, ref array< string > > m_EntryMods
SelectedPanel m_SelectedPanel
ServerBrowserEntry GetSelectedServer()
void Unfavorite(string uid)
ButtonWidget m_BtnPagePrev
void ButtonEnable(Widget w)
SpacerBaseWidget m_ServerList
void OnDetailsFocus(Widget w)
void AddFavoritesToFilter(GetServersInput input)
void SetServerDetails(GetServersResultRow server_info, bool online)
override bool OnFocusLost(Widget w, int x, int y)
Widget m_FilterSearchTextBox
ref ServerBrowserDetailsContainer m_Details
override bool OnFocus(Widget w, int x, int y)
ref set< string > m_OnlineFavServers
void SetCurrentPage(int page_num)
ButtonWidget m_BtnShowDetails
ServerBrowserMenuNew GetRootMenu()
static int COLOR_DISABLED_TEXT
GetServersResult the output structure of the GetServers operation.
int m_CurrentNumberPlayers
GetServersResultRow the output structure of the GetServers operation that represents one game server.
static void LoadServers(notnull GetServersInput inputValues)
void Remove(EntityAI item)
override void OnFilterFocus(Widget w)
override void PressThumbRight()
override void OnFilterFocusLost(Widget w)
override void PressSholderRight()
override bool IsFocusable(Widget w)
override void ShowServerDetails()
override void ColorDisable(Widget w)
override void ApplyFilters()
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override void SwitchToDetails(bool focus=true)
override void SetSort(ESortType type, ESortOrder order)
override void SwitchToFilters(bool focus=true)
override void ColorNormal(Widget w)
override int AddSorted(GetServersResultRow entry)
override void ResetFilters()
override bool PassFilter(GetServersResultRow result)
override void RefreshList()
override void OnLoadServersAsyncConsole(GetServersResult result_list, EBiosError error, string response)
override void UpdateServerList()
override void PressSholderLeft()
override void OnFilterChanged()
override bool OnMouseEnter(Widget w, int x, int y)
override void OnPressShoulder()
override void RightRelease()
override void OnLoadServerModsAsync(string server_id, array< string > mods)
override void Construct(Widget parent, ServerBrowserMenuNew menu, TabType type)
override void ColorHighlight(Widget w)
override void OnLoadServersAsyncPC(GetServersResult result_list, EBiosError error, string response)
override void RightHold()
override void LeftRelease()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
class array< Class T > TStringArray
@ NONE
body is not in simulation, nor in collision world
proto native int Length()
Returns length of string.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native int ToInt()
Converts string to integer.
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
proto int ToLower()
Changes string to lowercase. Returns length.
int ARGB(int a, int r, int g, int b)