Documentation
¶
Index ¶
- func DeserializeMethodCall(data []byte) (string, []any, error)
- func DeserializeMethodResponse(data []byte) (any, error)
- type Array
- type CData
- type CallbackEventArgs
- type EventEmitter
- type Fault
- type GbxCallbackStruct
- type GbxCallbacks
- type GbxClient
- func (client *GbxClient) AddGuest(login string) error
- func (client *GbxClient) AddGuestId(id int) error
- func (client *GbxClient) AddMap(filename string) error
- func (client *GbxClient) AddMapList(filenames []string) (int, error)
- func (client *GbxClient) AddScriptCallback(method string, key string, callback func(any))
- func (client *GbxClient) AppendPlaylistFromMatchSettings(filename string) (int, error)
- func (client *GbxClient) AreHornsDisabled() (bool, error)
- func (client *GbxClient) AreProfileSkinsDisabled() (bool, error)
- func (client *GbxClient) AreServiceAnnouncesDisabled() (bool, error)
- func (client *GbxClient) Authenticate(login string, password string) error
- func (client *GbxClient) AutoSaveReplays(enable bool) error
- func (client *GbxClient) AutoTeamBalance() error
- func (client *GbxClient) Ban(login string, reason string) error
- func (client *GbxClient) BanAndBlackList(login string, reason string, save bool) error
- func (client *GbxClient) BanId(id int, reason string) error
- func (client *GbxClient) BlackList(login string) error
- func (client *GbxClient) BlackListId(id int) error
- func (client *GbxClient) Call(method string, params ...any) (any, error)
- func (client *GbxClient) CallVote(vote string) error
- func (client *GbxClient) CallVoteEx(vote string, ratio float32, timeout int, who int) error
- func (client *GbxClient) CancelVote() error
- func (client *GbxClient) ChangeAuthPassword(login string, password string) error
- func (client *GbxClient) ChatEnableManualRouting(enable bool, forwardAll bool) error
- func (client *GbxClient) ChatForwardToLogin(message string, senderLogin string, destLogin string) error
- func (client *GbxClient) ChatSend(message string) error
- func (client *GbxClient) ChatSendServerMessage(message string) error
- func (client *GbxClient) ChatSendServerMessageToId(message string, playerId int) error
- func (client *GbxClient) ChatSendServerMessageToLogin(message string, login string) error
- func (client *GbxClient) ChatSendToId(message string, playerId int) error
- func (client *GbxClient) ChatSendToLogin(message string, login string) error
- func (client *GbxClient) CheckMapForCurrentServerParams(filename string) (bool, error)
- func (client *GbxClient) ChooseNextMap(filename string) error
- func (client *GbxClient) ChooseNextMapList(filenames []string) (int, error)
- func (client *GbxClient) CleanBanList() error
- func (client *GbxClient) CleanBlackList() error
- func (client *GbxClient) CleanGuestList() error
- func (client *GbxClient) Connect() error
- func (client *GbxClient) ConnectFakePlayer() error
- func (client *GbxClient) DisableHorns(disable bool) error
- func (client *GbxClient) DisableProfileSkins(disable bool) error
- func (client *GbxClient) DisableServiceAnnounces(disable bool) error
- func (client *GbxClient) Disconnect() error
- func (client *GbxClient) DisconnectFakePlayer(login string) error
- func (client *GbxClient) Echo(public string, internal string) error
- func (client *GbxClient) EnableCallbacks(enable bool) error
- func (client *GbxClient) ForcePlayerTeam(login string, team int) error
- func (client *GbxClient) ForcePlayerTeamId(playerID int, team int) error
- func (client *GbxClient) ForceScores(scores []structs.TMPlayerScore, silentMode ...bool) error
- func (client *GbxClient) ForceSpectator(login string, status int) error
- func (client *GbxClient) ForceSpectatorId(id int, status int) error
- func (client *GbxClient) ForceSpectatorTarget(spectator string, target string, cameraType int) error
- func (client *GbxClient) ForceSpectatorTargetId(spectator int, target int, cameraType int) error
- func (client *GbxClient) GameDataDirectory() (string, error)
- func (client *GbxClient) GetBanList(max int, start int) ([]structs.TMBanListEntry, error)
- func (client *GbxClient) GetBlackList(max int, start int) ([]structs.TMBlackListEntry, error)
- func (client *GbxClient) GetCurrentCallVote() (structs.TMCurrentCallVote, error)
- func (client *GbxClient) GetCurrentMapIndex() (int, error)
- func (client *GbxClient) GetCurrentMapInfo() (structs.TMMapInfo, error)
- func (client *GbxClient) GetCurrentRanking(max int, start int) ([]structs.TMPlayerRanking, error)
- func (client *GbxClient) GetCurrentRankingForLogin(login string) ([]structs.TMPlayerRanking, error)
- func (client *GbxClient) GetCurrentWinnerTeam() (int, error)
- func (client *GbxClient) GetDetailedPlayerInfo(login string) (structs.TMPlayerDetailedInfo, error)
- func (client *GbxClient) GetForceShowAllOpponents() (structs.TMForceShowAllOpponents, error)
- func (client *GbxClient) GetForcedClubLinks() (structs.TMForcedClubLinks, error)
- func (client *GbxClient) GetForcedTeams() (bool, error)
- func (client *GbxClient) GetGuestList(max int, start int) ([]structs.TMGuestListEntry, error)
- func (client *GbxClient) GetHideServer() (int, error)
- func (client *GbxClient) GetMainServerPlayerInfo(version ...int) (structs.TMPlayerInfo, error)
- func (client *GbxClient) GetMapInfo(filename string) (structs.TMMapInfo, error)
- func (client *GbxClient) GetMapList(max int, startIndex int) ([]structs.TMMapInfo, error)
- func (client *GbxClient) GetMapsDirectory() (string, error)
- func (client *GbxClient) GetMaxPlayers() (structs.TMMaxPlayers, error)
- func (client *GbxClient) GetMaxSpectators() (structs.TMMaxSpectators, error)
- func (client *GbxClient) GetModeScriptInfo() (structs.TMModeScriptInfo, error)
- func (client *GbxClient) GetModeScriptSettings() (map[string]any, error)
- func (client *GbxClient) GetModeScriptText() (string, error)
- func (client *GbxClient) GetNetworkStats() (structs.TMNetworkStats, error)
- func (client *GbxClient) GetNextMapIndex() (int, error)
- func (client *GbxClient) GetNextMapInfo() (structs.TMMapInfo, error)
- func (client *GbxClient) GetPlayerInfo(login string, version ...int) (structs.TMPlayerInfo, error)
- func (client *GbxClient) GetPlayerList(max int, start int, version ...int) ([]structs.TMPlayerInfo, error)
- func (client *GbxClient) GetScriptName() (structs.TMScriptName, error)
- func (client *GbxClient) GetServerComment() (string, error)
- func (client *GbxClient) GetServerName() (string, error)
- func (client *GbxClient) GetServerOptions() (structs.TMServerOptions, error)
- func (client *GbxClient) GetServerPassword() (string, error)
- func (client *GbxClient) GetServerPasswordForSpectator() (string, error)
- func (client *GbxClient) GetServerTags() ([]structs.TMServerTag, error)
- func (client *GbxClient) GetSkinsDirectory() (string, error)
- func (client *GbxClient) GetStatus() (structs.TMStatus, error)
- func (client *GbxClient) GetSystemInfo() (structs.TMSystemInfo, error)
- func (client *GbxClient) GetTeamInfo(clanID int) (structs.TMTeamInfo, error)
- func (client *GbxClient) GetValidationReplay(login string) (string, error)
- func (client *GbxClient) GetVersion() (structs.TMVersion, error)
- func (client *GbxClient) InsertMap(filename string) error
- func (client *GbxClient) InsertMapList(filenames []string) (int, error)
- func (client *GbxClient) InsertPlaylistFromMatchSettings(filename string) (int, error)
- func (client *GbxClient) IsAutoSaveReplaysEnabled() (bool, error)
- func (client *GbxClient) IsKeepingPlayerSlots() (bool, error)
- func (client *GbxClient) JumpToMapIdent(id string) error
- func (client *GbxClient) JumpToMapIndex(index int) error
- func (client *GbxClient) KeepPlayerSlots(keepPlayerSlots bool) error
- func (client *GbxClient) Kick(login string, reason string) error
- func (client *GbxClient) KickId(id int, reason string) error
- func (client *GbxClient) ListMethods() ([]string, error)
- func (client *GbxClient) LoadBlackList(fileName string) error
- func (client *GbxClient) LoadGuestList(fileName string) error
- func (client *GbxClient) LoadMatchSettings(filename string) (int, error)
- func (client *GbxClient) MethodHelp(method string) (string, error)
- func (client *GbxClient) MethodSignature(signature string) ([]structs.TMMethodSignature, error)
- func (client *GbxClient) NextMap(dontClearCupScores ...bool) error
- func (client *GbxClient) QuitGame() error
- func (client *GbxClient) RemoveGuest(login string) error
- func (client *GbxClient) RemoveGuestId(id int) error
- func (client *GbxClient) RemoveMap(filename string) error
- func (client *GbxClient) RemoveMapList(filenames []string) (int, error)
- func (client *GbxClient) RemoveScriptCallback(method string, key string)
- func (client *GbxClient) ResetServerTags() error
- func (client *GbxClient) RestartMap(dontClearCupScores ...bool) error
- func (client *GbxClient) SaveBestGhostsReplay(login string, filename string) error
- func (client *GbxClient) SaveBlackList(fileName string) error
- func (client *GbxClient) SaveCurrentReplay(filename string) error
- func (client *GbxClient) SaveGuestList(fileName string) error
- func (client *GbxClient) SaveMatchSettings(filename string) (int, error)
- func (client *GbxClient) Send(method string, params ...any) (any, error)
- func (client *GbxClient) SendDisplayManialinkPage(xml CData, timeout int, hideOnClick bool) error
- func (client *GbxClient) SendDisplayManialinkPageToId(uid int, xml CData, timeout int, hideOnClick bool) error
- func (client *GbxClient) SendDisplayManialinkPageToLogin(login string, xml CData, timeout int, hideOnClick bool) error
- func (client *GbxClient) SendHideManialinkPage() error
- func (client *GbxClient) SendHideManialinkPageToId(uid int) error
- func (client *GbxClient) SendHideManialinkPageToLogin(login string) error
- func (client *GbxClient) SetApiVersion(version string) error
- func (client *GbxClient) SetConnectionRates(download int, upload int) error
- func (client *GbxClient) SetForceShowAllOpponents(opponents int) error
- func (client *GbxClient) SetForcedClubLinks(clubLink1 string, clubLink2 string) error
- func (client *GbxClient) SetForcedTeams(forced bool) error
- func (client *GbxClient) SetHideServer(visibility int) error
- func (client *GbxClient) SetMaxPlayers(maxPlayers int) error
- func (client *GbxClient) SetMaxSpectators(maxSpectators int) error
- func (client *GbxClient) SetModeScriptSettings(settings map[string]any) error
- func (client *GbxClient) SetModeScriptText(script string) error
- func (client *GbxClient) SetNextMapIdent(id string) error
- func (client *GbxClient) SetNextMapIndex(index int) error
- func (client *GbxClient) SetScriptName(scriptName string) error
- func (client *GbxClient) SetServerComment(comment string) error
- func (client *GbxClient) SetServerName(name string) error
- func (client *GbxClient) SetServerOptions(options structs.TMServerOptionsRequest) error
- func (client *GbxClient) SetServerPassword(password string) error
- func (client *GbxClient) SetServerPasswordForSpectator(password string) error
- func (client *GbxClient) SetServerTag(tag string, value string) error
- func (client *GbxClient) SetTeamInfo(name string, huePrimary float32, zonePath string, par4 string, par5 float32, ...) error
- func (client *GbxClient) SpectatorReleasePlayerSlot(login string) error
- func (client *GbxClient) SpectatorReleasePlayerSlotId(id int) error
- func (client *GbxClient) StartServerInternet() error
- func (client *GbxClient) StartServerLan() error
- func (client *GbxClient) StopServer() error
- func (client *GbxClient) TriggerModeScriptEvent(method string, param string) error
- func (client *GbxClient) TriggerModeScriptEventArray(method string, params []string) error
- func (client *GbxClient) UnBan(login string) error
- func (client *GbxClient) UnBlackList(login string) error
- func (client *GbxClient) UnsetServerTag(tag string) error
- type Member
- type MethodCall
- type MethodResponse
- type Options
- type Param
- type PromiseResult
- type Struct
- type Value
- type XMLParam
- type XMLRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackEventArgs ¶
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
func (*EventEmitter) On ¶
func (e *EventEmitter) On(event string, ch chan any)
type GbxCallbackStruct ¶ added in v0.7.0
type GbxCallbacks ¶
type GbxCallbacks struct { OnAnyCallback []GbxCallbackStruct[CallbackEventArgs] OnBeginMap []GbxCallbackStruct[events.MapEventArgs] OnBeginMatch []GbxCallbackStruct[struct{}] // No args OnEcho []GbxCallbackStruct[events.EchoEventArgs] OnEndMap []GbxCallbackStruct[events.MapEventArgs] OnEndMatch []GbxCallbackStruct[events.EndMatchEventArgs] OnEndRound []GbxCallbackStruct[events.ScoresEventArgs] OnPreEndRound []GbxCallbackStruct[events.ScoresEventArgs] OnMapListModified []GbxCallbackStruct[events.MapListModifiedEventArgs] OnPlayerAlliesChanged []GbxCallbackStruct[events.PlayerAlliesChangedEventArgs] OnPlayerChat []GbxCallbackStruct[events.PlayerChatEventArgs] OnPlayerConnect []GbxCallbackStruct[events.PlayerConnectEventArgs] OnPlayerDisconnect []GbxCallbackStruct[events.PlayerDisconnectEventArgs] OnPlayerInfoChanged []GbxCallbackStruct[events.PlayerInfoChangedEventArgs] OnPlayerManialinkPageAnswer []GbxCallbackStruct[events.PlayerManialinkPageAnswerEventArgs] OnServerStart []GbxCallbackStruct[struct{}] // No args OnServerStop []GbxCallbackStruct[struct{}] // No args OnStatusChanged []GbxCallbackStruct[events.StatusChangedEventArgs] OnTunnelDataReceived []GbxCallbackStruct[events.TunnelDataReceivedEventArgs] OnVoteUpdated []GbxCallbackStruct[events.VoteUpdatedEventArgs] OnPlayerCheckpoint []GbxCallbackStruct[events.PlayerWayPointEventArgs] OnPlayerFinish []GbxCallbackStruct[events.PlayerWayPointEventArgs] OnPlayerIncoherence []GbxCallbackStruct[events.PlayerIncoherenceEventArgs] OnPlayerGiveUp []GbxCallbackStruct[events.PlayerGiveUpEventArgs] OnStartLine []GbxCallbackStruct[events.StartLineEventArgs] OnWarmUpStart []GbxCallbackStruct[struct{}] // No args OnWarmUpStartRound []GbxCallbackStruct[events.WarmUpEventArgs] OnWarmUpEndRound []GbxCallbackStruct[events.WarmUpEventArgs] OnWarmUpEnd []GbxCallbackStruct[struct{}] // No args OnStartRound []GbxCallbackStruct[struct{}] // No args OnElimination []GbxCallbackStruct[events.EliminationEventArgs] }
type GbxClient ¶
type GbxClient struct { GbxCallbacks Host string Port int IsConnected bool DoHandShake bool ReqHandle uint32 Socket net.Conn Mutex sync.Mutex RecvData bytes.Buffer ResponseLength *uint32 DataPointer int Options Options PromiseCallbacks map[uint32]chan PromiseResult Events EventEmitter ScriptCallbacks map[string][]GbxCallbackStruct[any] }
func (*GbxClient) AddGuest ¶
Add the player with the specified login on the guest list. Only available to Admin.
func (*GbxClient) AddGuestId ¶
Add the player with the specified PlayerId on the guest list. Only available to Admin.
func (*GbxClient) AddMap ¶
Add the map with the specified filename at the end of the current selection. Only available to Admin.
func (*GbxClient) AddMapList ¶
Add the list of maps with the specified filenames at the end of the current selection. The list of maps to add is an array of strings. Only available to Admin.
func (*GbxClient) AddScriptCallback ¶ added in v1.0.0
func (*GbxClient) AppendPlaylistFromMatchSettings ¶
Add a list of maps defined in the playlist with the specified filename at the end of the current selection. Only available to Admin.
func (*GbxClient) AreHornsDisabled ¶
Returns whether the horns are disabled.
func (*GbxClient) AreProfileSkinsDisabled ¶
Returns whether the custom skins are disabled.
func (*GbxClient) AreServiceAnnouncesDisabled ¶
Returns whether the automatic mesages are disabled.
func (*GbxClient) Authenticate ¶
Allow user authentication by specifying a login and a password, to gain access to the set of functionalities corresponding to this authorization level.
func (*GbxClient) AutoSaveReplays ¶
Enable the autosaving of all replays (vizualisable replays with all players, but not validable) on the server. Only available to SuperAdmin.
func (*GbxClient) AutoTeamBalance ¶
Attempt to balance teams. Only available to Admin.
func (*GbxClient) Ban ¶
Ban the player with the specified login, with an optional message. Only available to Admin.
func (*GbxClient) BanAndBlackList ¶
Ban the player with the specified login, with a message. Add it to the black list, and optionally save the new list. Only available to Admin.
func (*GbxClient) BanId ¶
Ban the player with the specified PlayerId, with an optional message. Only available to Admin.
func (*GbxClient) BlackList ¶
Blacklist the player with the specified login. Only available to SuperAdmin.
func (*GbxClient) BlackListId ¶
Blacklist the player with the specified PlayerId. Only available to SuperAdmin.
func (*GbxClient) CallVote ¶
Call a vote for a cmd. The command is a XML string corresponding to an XmlRpc request. Only available to Admin.
func (*GbxClient) CallVoteEx ¶
Extended call vote. Same as CallVote, but you can additionally supply specific parameters for this vote: a ratio, a time out and who is voting. Special timeout values: a ratio of '-1' means default; a timeout of '0' means default, '1' means indefinite; Voters values: '0' means only active players, '1' means any player, '2' is for everybody, pure spectators included. Only available to Admin.
func (*GbxClient) CancelVote ¶
Cancel the current vote. Only available to Admin.
func (*GbxClient) ChangeAuthPassword ¶
Change the password for the specified login/user. Only available to SuperAdmin.
func (*GbxClient) ChatEnableManualRouting ¶
The chat messages are no longer dispatched to the players, they only go to the rpc callback and the controller has to manually forward them. The second (optional) parameter allows all messages from the server to be automatically forwarded. Only available to Admin.
func (*GbxClient) ChatForwardToLogin ¶
func (client *GbxClient) ChatForwardToLogin(message string, senderLogin string, destLogin string) error
(Text, SenderLogin, DestLogin) Send a text message to the specified DestLogin (or everybody if empty) on behalf of SenderLogin. DestLogin can be a single login or a list of comma-separated logins. Only available if manual routing is enabled. Only available to Admin.
func (*GbxClient) ChatSendServerMessage ¶
Send a text message to all clients without the server login. Only available to Admin.
func (*GbxClient) ChatSendServerMessageToId ¶
Send a text message without the server login to the client with the specified PlayerId. Only available to Admin.
func (*GbxClient) ChatSendServerMessageToLogin ¶
Send a text message without the server login to the client with the specified login. Login can be a single login or a list of comma-separated logins. Only available to Admin.
func (*GbxClient) ChatSendToId ¶
Send a text message to the client with the specified PlayerId. Only available to Admin.
func (*GbxClient) ChatSendToLogin ¶
Send a text message to the client with the specified login. Login can be a single login or a list of comma-separated logins. Only available to Admin.
func (*GbxClient) CheckMapForCurrentServerParams ¶
Returns a boolean if the map with the specified filename matches the current server settings.
func (*GbxClient) ChooseNextMap ¶
Set as next map the one with the specified filename, if it is present in the selection. Only available to Admin.
func (*GbxClient) ChooseNextMapList ¶
Set as next maps the list of maps with the specified filenames, if they are present in the selection. The list of maps to choose is an array of strings. Only available to Admin.
func (*GbxClient) CleanBanList ¶
Clean the ban list of the server. Only available to Admin.
func (*GbxClient) CleanBlackList ¶
Clean the blacklist of the server. Only available to SuperAdmin.
func (*GbxClient) CleanGuestList ¶
Clean the guest list of the server. Only available to Admin.
func (*GbxClient) ConnectFakePlayer ¶
(debug tool) Connect a fake player to the server. Only available to Admin.
func (*GbxClient) DisableHorns ¶
Disable player horns. Only available to Admin.
func (*GbxClient) DisableProfileSkins ¶
Ignore players profile skin customisation. Only available to Admin.
func (*GbxClient) DisableServiceAnnounces ¶
Disable the automatic mesages when a player connects/disconnects from the server. Only available to Admin.
func (*GbxClient) Disconnect ¶
func (*GbxClient) DisconnectFakePlayer ¶
(debug tool) Disconnect a fake player, or all the fake players if login is '*'. Only available to Admin.
func (*GbxClient) Echo ¶
Just log the parameters and invoke a callback. Can be used to talk to other xmlrpc clients connected, or to make custom votes. If used in a callvote, the first parameter will be used as the vote message on the clients. Only available to Admin.
func (*GbxClient) EnableCallbacks ¶
Allow the GameServer to call you back.
func (*GbxClient) ForcePlayerTeam ¶
Force the team of the player. Only available in team mode. You have to pass the login and the team number (0 or 1). Only available to Admin.
func (*GbxClient) ForcePlayerTeamId ¶
Force the team of the player. Only available in team mode. You have to pass the playerid and the team number (0 or 1). Only available to Admin.
func (*GbxClient) ForceScores ¶
func (client *GbxClient) ForceScores(scores []structs.TMPlayerScore, silentMode ...bool) error
Force the scores of the current game. Only available in rounds and team mode. You have to pass an array of structs {int PlayerId, int Score}. And a boolean SilentMode - if true, the scores are silently updated (only available for SuperAdmin), allowing an external controller to do its custom counting... Only available to Admin/SuperAdmin.
func (*GbxClient) ForceSpectator ¶
Force the spectating status of the player. You have to pass the login and the spectator mode (0: user selectable, 1: spectator, 2: player, 3: spectator but keep selectable). Only available to Admin.
func (*GbxClient) ForceSpectatorId ¶
Force the spectating status of the player. You have to pass the playerid and the spectator mode (0: user selectable, 1: spectator, 2: player, 3: spectator but keep selectable). Only available to Admin.
func (*GbxClient) ForceSpectatorTarget ¶
func (client *GbxClient) ForceSpectatorTarget(spectator string, target string, cameraType int) error
Force spectators to look at a specific player. You have to pass the login of the spectator (or ” for all) and the login of the target (or ” for automatic), and an integer for the camera type to use (-1 = leave unchanged, 0 = replay, 1 = follow, 2 = free). Only available to Admin.
func (*GbxClient) ForceSpectatorTargetId ¶
Force spectators to look at a specific player. You have to pass the id of the spectator (or -1 for all) and the id of the target (or -1 for automatic), and an integer for the camera type to use (-1 = leave unchanged, 0 = replay, 1 = follow, 2 = free). Only available to Admin.
func (*GbxClient) GameDataDirectory ¶
Returns the path of the game datas directory. Only available to Admin.
func (*GbxClient) GetBanList ¶
Returns the list of banned players. This method takes two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structures. Each structure contains the following fields : Login, ClientName and IPAddress.
func (*GbxClient) GetBlackList ¶
Returns the list of blacklisted players. This method takes two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structures. Each structure contains the following fields : Login.
func (*GbxClient) GetCurrentCallVote ¶
func (client *GbxClient) GetCurrentCallVote() (structs.TMCurrentCallVote, error)
Returns the vote currently in progress. The returned structure is { CallerLogin, CmdName, CmdParam }.
func (*GbxClient) GetCurrentMapIndex ¶
Returns the current map index in the selection, or -1 if the map is no longer in the selection.
func (*GbxClient) GetCurrentMapInfo ¶
Returns a struct containing the infos for the current map. The struct contains the following fields : Name, UId, FileName, Author, AuthorNickname, Environnement, Mood, BronzeTime, SilverTime, GoldTime, AuthorTime, CopperPrice, LapRace, NbLaps, NbCheckpoints, MapType, MapStyle.
func (*GbxClient) GetCurrentRanking ¶
Returns the current rankings for the race in progress. (In trackmania legacy team modes, the scores for the two teams are returned. In other modes, it's the individual players' scores) This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the ranking. The ranking returned is a list of structures. Each structure contains the following fields : Login, NickName, PlayerId and Rank. In addition, for legacy trackmania modes it also contains BestTime, Score, NbrLapsFinished, LadderScore, and an array BestCheckpoints that contains the checkpoint times for the best race.
func (*GbxClient) GetCurrentRankingForLogin ¶
func (client *GbxClient) GetCurrentRankingForLogin(login string) ([]structs.TMPlayerRanking, error)
Returns the current ranking for the race in progressof the player with the specified login (or list of comma-separated logins). The ranking returned is a list of structures. Each structure contains the following fields : Login, NickName, PlayerId and Rank. In addition, for legacy trackmania modes it also contains BestTime, Score, NbrLapsFinished, LadderScore, and an array BestCheckpoints that contains the checkpoint times for the best race.
func (*GbxClient) GetCurrentWinnerTeam ¶
Returns the current winning team for the race in progress. (-1: if not in team mode, or draw match)
func (*GbxClient) GetDetailedPlayerInfo ¶
func (client *GbxClient) GetDetailedPlayerInfo(login string) (structs.TMPlayerDetailedInfo, error)
Returns a struct containing the infos on the player with the specified login. The structure contains the following fields : Login, NickName, PlayerId, TeamId, IPAddress, DownloadRate, UploadRate, Language, IsSpectator, IsInOfficialMode, a structure named Avatar, an array of structures named Skins, a structure named LadderStats, HoursSinceZoneInscription and OnlineRights (0: nations account, 3: united account). Each structure of the array Skins contains two fields Environnement and a struct PackDesc. Each structure PackDesc, as well as the struct Avatar, contains two fields FileName and Checksum.
func (*GbxClient) GetForceShowAllOpponents ¶
func (client *GbxClient) GetForceShowAllOpponents() (structs.TMForceShowAllOpponents, error)
Get whether players are forced to show all opponents. The struct returned contains two fields CurrentValue and NextValue.
func (*GbxClient) GetForcedClubLinks ¶
func (client *GbxClient) GetForcedClubLinks() (structs.TMForcedClubLinks, error)
Get the forced clublinks.
func (*GbxClient) GetForcedTeams ¶
Returns whether the players can choose their side or if the teams are forced by the server.
func (*GbxClient) GetGuestList ¶
Returns the list of players on the guest list. This method takes two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list. The list is an array of structures. Each structure contains the following fields : Login.
func (*GbxClient) GetHideServer ¶
Get whether the server wants to be hidden from the public server list.
func (*GbxClient) GetMainServerPlayerInfo ¶
func (client *GbxClient) GetMainServerPlayerInfo(version ...int) (structs.TMPlayerInfo, error)
Returns a struct containing the player infos of the game server (ie: in case of a basic server, itself; in case of a relay server, the main server), with an optional parameter for compatibility: struct version (0 = united, 1 = forever). The structure is identical to the ones from GetPlayerList. Forever PlayerInfo struct is: Login, NickName, PlayerId, TeamId, SpectatorStatus, LadderRanking, and Flags. LadderRanking is 0 when not in official mode, Flags = ForceSpectator(0,1,2) + StereoDisplayMode * 1000 + IsManagedByAnOtherServer * 10000 + IsServer * 100000 + HasPlayerSlot * 1000000 + IsBroadcasting * 10000000 + HasJoinedGame * 100000000 SpectatorStatus = Spectator + TemporarySpectator * 10 + PureSpectator * 100 + AutoTarget * 1000 + CurrentTargetId * 10000
func (*GbxClient) GetMapInfo ¶
Returns a struct containing the infos for the map with the specified filename. The struct contains the following fields : Name, UId, FileName, Author, AuthorNickname, Environnement, Mood, BronzeTime, SilverTime, GoldTime, AuthorTime, CopperPrice, LapRace, MapType, MapStyle. (NbLaps and NbCheckpoints are also present but always set to -1)
func (*GbxClient) GetMapList ¶
Returns a list of maps among the current selection of the server. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the selection. The list is an array of structures. Each structure contains the following fields : Name, UId, FileName, Environnement, Author, AuthorNickname, GoldTime, CopperPrice, MapType, MapStyle.
func (*GbxClient) GetMapsDirectory ¶
Returns the path of the maps directory. Only available to Admin.
func (*GbxClient) GetMaxPlayers ¶
func (client *GbxClient) GetMaxPlayers() (structs.TMMaxPlayers, error)
Get the current and next maximum number of players allowed on server. The struct returned contains two fields CurrentValue and NextValue.
func (*GbxClient) GetMaxSpectators ¶
func (client *GbxClient) GetMaxSpectators() (structs.TMMaxSpectators, error)
Get the current and next maximum number of spectators allowed on server. The struct returned contains two fields CurrentValue and NextValue.
func (*GbxClient) GetModeScriptInfo ¶
func (client *GbxClient) GetModeScriptInfo() (structs.TMModeScriptInfo, error)
Returns the description of the current mode script, as a structure containing: Name, CompatibleTypes, Description, Version and the settings available.
func (*GbxClient) GetModeScriptSettings ¶
Returns the current settings of the mode script.
func (*GbxClient) GetModeScriptText ¶
Get the current mode script.
func (*GbxClient) GetNetworkStats ¶
func (client *GbxClient) GetNetworkStats() (structs.TMNetworkStats, error)
Returns a struct containing the networks stats of the server. The structure contains the following fields : Uptime, NbrConnection, MeanConnectionTime, MeanNbrPlayer, RecvNetRate, SendNetRate, TotalReceivingSize, TotalSendingSize and an array of structures named PlayerNetInfos. Each structure of the array PlayerNetInfos contains the following fields : Login, IPAddress, LastTransferTime, DeltaBetweenTwoLastNetState, PacketLossRate. Only available to SuperAdmin.
func (*GbxClient) GetNextMapIndex ¶
Returns the map index in the selection that will be played next (unless the current one is restarted...)
func (*GbxClient) GetNextMapInfo ¶
Returns a struct containing the infos for the next map. The struct contains the following fields : Name, UId, FileName, Author, AuthorNickname, Environnement, Mood, BronzeTime, SilverTime, GoldTime, AuthorTime, CopperPrice, LapRace, MapType, MapStyle. (NbLaps and NbCheckpoints are also present but always set to -1)
func (*GbxClient) GetPlayerInfo ¶
Returns a struct containing the infos on the player with the specified login, with an optional parameter for compatibility: struct version (0 = united, 1 = forever). The structure is identical to the ones from GetPlayerList. Forever PlayerInfo struct is: Login, NickName, PlayerId, TeamId, SpectatorStatus, LadderRanking, and Flags. LadderRanking is 0 when not in official mode, Flags = ForceSpectator(0,1,2) + StereoDisplayMode * 1000 + IsManagedByAnOtherServer * 10000 + IsServer * 100000 + HasPlayerSlot * 1000000 + IsBroadcasting * 10000000 + HasJoinedGame * 100000000 SpectatorStatus = Spectator + TemporarySpectator * 10 + PureSpectator * 100 + AutoTarget * 1000 + CurrentTargetId * 10000
func (*GbxClient) GetPlayerList ¶
func (client *GbxClient) GetPlayerList(max int, start int, version ...int) ([]structs.TMPlayerInfo, error)
Returns the list of players on the server. This method take two parameters. The first parameter specifies the maximum number of infos to be returned, and the second one the starting index in the list, an optional 3rd parameter is used for compatibility: struct version (0 = united, 1 = forever, 2 = forever, including the servers). The list is an array of PlayerInfo structures. Forever PlayerInfo struct is: Login, NickName, PlayerId, TeamId, SpectatorStatus, LadderRanking, and Flags. LadderRanking is 0 when not in official mode, Flags = ForceSpectator(0,1,2) + StereoDisplayMode * 1000 + IsManagedByAnOtherServer * 10000 + IsServer * 100000 + HasPlayerSlot * 1000000 + IsBroadcasting * 10000000 + HasJoinedGame * 100000000 SpectatorStatus = Spectator + TemporarySpectator * 10 + PureSpectator * 100 + AutoTarget * 1000 + CurrentTargetId * 10000
func (*GbxClient) GetScriptName ¶
func (client *GbxClient) GetScriptName() (structs.TMScriptName, error)
Get the current and next mode script name for script mode. The struct returned contains two fields CurrentValue and NextValue.
func (*GbxClient) GetServerComment ¶
Get the server comment in utf8 format.
func (*GbxClient) GetServerName ¶
Get the server name in utf8 format.
func (*GbxClient) GetServerOptions ¶
func (client *GbxClient) GetServerOptions() (structs.TMServerOptions, error)
Returns a struct containing the server options: Name, Comment, Password, PasswordForSpectator, HideServer, CurrentMaxPlayers, NextMaxPlayers, CurrentMaxSpectators, NextMaxSpectators, KeepPlayerSlots, CurrentCallVoteTimeOut, NextCallVoteTimeOut, CallVoteRatio, AllowMapDownload, AutoSaveReplays, ClientInputsMaxLatency, DisableHorns, DisableServiceAnnounces,PacketAssembly_PacketsPerFrame, PacketAssembly_FullPacketsPerFrame, TrustClientSimu_ClientToServer_SendingRate, DelayedVisuals_ServerToClient_SendingRate.
func (*GbxClient) GetServerPassword ¶
Get the server password if called as Admin or Super Admin, else returns if a password is needed or not.
func (*GbxClient) GetServerPasswordForSpectator ¶
Get the password for spectator mode if called as Admin or Super Admin, else returns if a password is needed or not.
func (*GbxClient) GetServerTags ¶
func (client *GbxClient) GetServerTags() ([]structs.TMServerTag, error)
Returns the list of tags and associated values set on this server. Only available to Admin.
func (*GbxClient) GetSkinsDirectory ¶
Returns the path of the skins directory. Only available to Admin.
func (*GbxClient) GetSystemInfo ¶
func (client *GbxClient) GetSystemInfo() (structs.TMSystemInfo, error)
Get some system infos, including connection rates (in kbps).
func (*GbxClient) GetTeamInfo ¶
func (client *GbxClient) GetTeamInfo(clanID int) (structs.TMTeamInfo, error)
Return Team info for a given clan (0 = no clan, 1, 2). The structure contains: Name, ZonePath, City, EmblemUrl, HuePrimary, HueSecondary, RGB, ClubLinkUrl. Only available to Admin.
func (*GbxClient) GetValidationReplay ¶
Returns a replay containing the data needed to validate the current best time of the player. The parameter is the login of the player.
func (*GbxClient) GetVersion ¶
Returns a struct with the Name, TitleId, Version, Build and ApiVersion of the application remotely controlled.
func (*GbxClient) InsertMap ¶
Insert the map with the specified filename after the current map. Only available to Admin.
func (*GbxClient) InsertMapList ¶
Insert the list of maps with the specified filenames after the current map. The list of maps to insert is an array of strings. Only available to Admin.
func (*GbxClient) InsertPlaylistFromMatchSettings ¶
Insert a list of maps defined in the playlist with the specified filename after the current map. Only available to Admin.
func (*GbxClient) IsAutoSaveReplaysEnabled ¶
Returns if autosaving of all replays is enabled on the server.
func (*GbxClient) IsKeepingPlayerSlots ¶
Get whether the server keeps player slots when switching to spectator.
func (*GbxClient) JumpToMapIdent ¶
Immediately jumps to the map designated by its identifier (it must be in the selection).
func (*GbxClient) JumpToMapIndex ¶
Immediately jumps to the map designated by the index in the selection.
func (*GbxClient) KeepPlayerSlots ¶
Set whether, when a player is switching to spectator, the server should still consider him a player and keep his player slot, or not. Only available to Admin.
func (*GbxClient) Kick ¶
Kick the player with the specified login, with an optional message. Only available to Admin.
func (*GbxClient) KickId ¶
Kick the player with the specified PlayerId, with an optional message. Only available to Admin.
func (*GbxClient) ListMethods ¶
Return an array of all available XML-RPC methods on this server.
func (*GbxClient) LoadBlackList ¶
Load the black list file with the specified file name. Only available to Admin.
func (*GbxClient) LoadGuestList ¶
Load the guest list file with the specified file name. Only available to Admin.
func (*GbxClient) LoadMatchSettings ¶
Set a list of maps defined in the playlist with the specified filename as the current selection of the server, and load the gameinfos from the same file. Only available to Admin.
func (*GbxClient) MethodHelp ¶
Given the name of a method, return a help string.
func (*GbxClient) MethodSignature ¶
func (client *GbxClient) MethodSignature(signature string) ([]structs.TMMethodSignature, error)
Given the name of a method, return an array of legal signatures. Each signature is an array of strings. The first item of each signature is the return type, and any others items are parameter types.
func (*GbxClient) NextMap ¶
Switch to next map with an optional boolean parameter DontClearCupScores
func (*GbxClient) RemoveGuest ¶
Remove the player with the specified login from the guest list. Only available to Admin.
func (*GbxClient) RemoveGuestId ¶
Remove the player with the specified PlayerId from the guest list. Only available to Admin.
func (*GbxClient) RemoveMap ¶
Remove the map with the specified filename from the current selection. Only available to Admin.
func (*GbxClient) RemoveMapList ¶
Remove the list of maps with the specified filenames from the current selection. The list of maps to remove is an array of strings. Only available to Admin.
func (*GbxClient) RemoveScriptCallback ¶ added in v1.0.0
func (*GbxClient) ResetServerTags ¶
Reset all tags on the server. Only available to Admin.
func (*GbxClient) RestartMap ¶
Restarts the map with an optional boolean parameter DontClearCupScores
func (*GbxClient) SaveBestGhostsReplay ¶
Saves a replay with the ghost of all the players' best race. First parameter is the login of the player (or ” for all players), Second parameter is the filename, or ” for an automatic filename. Only available to Admin.
func (*GbxClient) SaveBlackList ¶
Save the black list in the file with specified file name. Only available to Admin.
func (*GbxClient) SaveCurrentReplay ¶
Saves the current replay (vizualisable replays with all players, but not validable). Pass a filename, or ” for an automatic filename. Only available to Admin.
func (*GbxClient) SaveGuestList ¶
Save the guest list in the file with specified file name. Only available to Admin.
func (*GbxClient) SaveMatchSettings ¶
Save the current selection of map in the playlist with the specified filename, as well as the current gameinfos. Only available to Admin.
func (*GbxClient) SendDisplayManialinkPage ¶
Display a manialink page on all clients. The parameters are the xml description of the page to display, a timeout to autohide it (0 = permanent), and a boolean to indicate whether the page must be hidden as soon as the user clicks on a page option. Only available to Admin.
func (*GbxClient) SendDisplayManialinkPageToId ¶
func (client *GbxClient) SendDisplayManialinkPageToId(uid int, xml CData, timeout int, hideOnClick bool) error
Display a manialink page on the client with the specified UId. The first parameter is the UId of the player, the other are identical to 'SendDisplayManialinkPage'. Only available to Admin.
func (*GbxClient) SendDisplayManialinkPageToLogin ¶
func (client *GbxClient) SendDisplayManialinkPageToLogin(login string, xml CData, timeout int, hideOnClick bool) error
Display a manialink page on the client with the specified login. The first parameter is the login of the player, the other are identical to 'SendDisplayManialinkPage'. Login can be a single login or a list of comma-separated logins. Only available to Admin.
func (*GbxClient) SendHideManialinkPage ¶
Hide the displayed manialink page on all clients. Only available to Admin.
func (*GbxClient) SendHideManialinkPageToId ¶
Hide the displayed manialink page on the client with the specified UId. Only available to Admin.
func (*GbxClient) SendHideManialinkPageToLogin ¶
Hide the displayed manialink page on the client with the specified login. Login can be a single login or a list of comma-separated logins. Only available to Admin.
func (*GbxClient) SetApiVersion ¶
Define the wanted api.
func (*GbxClient) SetConnectionRates ¶
Set the download and upload rates (in kbps).
func (*GbxClient) SetForceShowAllOpponents ¶
Set whether to override the players preferences and always display all opponents (0=no override, 1=show all, other value=minimum number of opponents). Only available to Admin. Requires a map restart to be taken into account.
func (*GbxClient) SetForcedClubLinks ¶
Set the clublinks to use for the two clans. Only available to Admin.
func (*GbxClient) SetForcedTeams ¶
Set whether the players can choose their side or if the teams are forced by the server (using ForcePlayerTeam()). Only available to Admin.
func (*GbxClient) SetHideServer ¶
Set whether the server should be hidden from the public server list (0 = visible, 1 = always hidden, 2 = hidden from nations). Only available to Admin.
func (*GbxClient) SetMaxPlayers ¶
Set a new maximum number of players. Only available to Admin. Requires a map restart to be taken into account.
func (*GbxClient) SetMaxSpectators ¶
Set a new maximum number of Spectators. Only available to Admin. Requires a map restart to be taken into account.
func (*GbxClient) SetModeScriptSettings ¶
Change the settings of the mode script. Only available to Admin.
func (*GbxClient) SetModeScriptText ¶
Set the mode script and restart. Only available to Admin.
func (*GbxClient) SetNextMapIdent ¶
Sets the map in the selection that will be played next (unless the current one is restarted...)
func (*GbxClient) SetNextMapIndex ¶
Sets the map index in the selection that will be played next (unless the current one is restarted...)
func (*GbxClient) SetScriptName ¶
Set a new mode script name for script mode. Only available to Admin. Requires a map restart to be taken into account.
func (*GbxClient) SetServerComment ¶
Set a new server comment in utf8 format. Only available to Admin.
func (*GbxClient) SetServerName ¶
Set a new server name in utf8 format. Only available to Admin.
func (*GbxClient) SetServerOptions ¶
func (client *GbxClient) SetServerOptions(options structs.TMServerOptionsRequest) error
Set new server options using the struct passed as parameters. This struct must contain the following fields : Name, Comment, Password, PasswordForSpectator, NextCallVoteTimeOut, CallVoteRatio. May additionally include any of the other members listed in RpcGetServerOptions. Only available to Admin. A change of NextMaxPlayers, NextMaxSpectators, NextCallVoteTimeOut requires a map restart to be taken into account.
func (*GbxClient) SetServerPassword ¶
Set a new password for the server. Only available to Admin.
func (*GbxClient) SetServerPasswordForSpectator ¶
Set a new password for the spectator mode. Only available to Admin.
func (*GbxClient) SetServerTag ¶
Set a tag and its value on the server. This method takes two parameters. The first parameter specifies the name of the tag, and the second one its value. The list is an array of structures {string Name, string Value}. Only available to Admin.
func (*GbxClient) SetTeamInfo ¶
func (client *GbxClient) SetTeamInfo(name string, huePrimary float32, zonePath string, par4 string, par5 float32, par6 string, par7 string, par8 float32, par9 string) error
Set Team names and colors (deprecated). Only available to Admin.
func (*GbxClient) SpectatorReleasePlayerSlot ¶
Pass the login of the spectator. A spectator that once was a player keeps his player slot, so that he can go back to race mode. Calling this function frees this slot for another player to connect. Only available to Admin.
func (*GbxClient) SpectatorReleasePlayerSlotId ¶
Pass the playerid of the spectator. A spectator that once was a player keeps his player slot, so that he can go back to race mode. Calling this function frees this slot for another player to connect. Only available to Admin.
func (*GbxClient) StartServerInternet ¶
Start a server on internet, using the current configuration. Only available to SuperAdmin.
func (*GbxClient) StartServerLan ¶
Start a server on lan, using the current configuration. Only available to SuperAdmin.
func (*GbxClient) StopServer ¶
Stop the server. Only available to SuperAdmin.
func (*GbxClient) TriggerModeScriptEvent ¶
Send an event to the mode script. Only available to Admin.
func (*GbxClient) TriggerModeScriptEventArray ¶
Send an event to the mode script. Only available to Admin.
func (*GbxClient) UnBlackList ¶
UnTMBlackListEntry the player with the specified login. Only available to SuperAdmin.
func (*GbxClient) UnsetServerTag ¶
Unset the tag with the specified name on the server. Only available to Admin.