Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use structs in the server browser #623

Merged
merged 7 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 4 additions & 70 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,76 +449,10 @@
"argTypes":""
},
{
"name":"NSGetServerName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerDescription",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerMap",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerPlaylist",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerPlayerCount",
"helpText":"",
"returnTypeString":"int",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerMaxPlayerCount",
"helpText":"",
"returnTypeString":"int",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerID",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSServerRequiresPassword",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerRequiredModsCount",
"helpText":"",
"returnTypeString":"int",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerRegion",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex"
},
{
"name":"NSGetServerRequiredModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex, int modIndex"
},
{
"name":"NSGetServerRequiredModVersion",
"helpText":"",
"returnTypeString":"string",
"argTypes":"int serverIndex, int modIndex"
"name": "NSGetGameServers",
"helpText": "Gets all fetched servers",
"returnTypeString": "array<ServerInfo>",
"argTypes": ""
},
{
"name":"NSClearRecievedServerList",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,25 @@ global struct UIPresenceStruct {
bool isLobby
string loadingLevel
string loadedLevel
}
}

global struct RequiredModInfo
{
string name
string version
}

global struct ServerInfo
{
int index
string id
string name
string description
string map
string playlist
int playerCount
int maxPlayerCount
bool requiresPassword
string region
array< RequiredModInfo > requiredMods
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ void function OnConnectWithPasswordMenuOpened()
void function ConnectWithPassword( var button )
{
if ( GetTopNonDialogMenu() == file.menu )
{
TriggerConnectToServerCallbacks()
thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ) )
}
}
Loading