Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
steam_gameserver.h
Go to the documentation of this file.
1
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
2
//
3
// Purpose:
4
//
5
//=============================================================================
6
7
#ifndef STEAM_GAMESERVER_H
8
#define STEAM_GAMESERVER_H
9
#ifdef _WIN32
10
#pragma once
11
#endif
12
13
#include "
steam_api.h
"
14
#include "
isteamgameserver.h
"
15
#include "
isteamgameserverstats.h
"
16
17
enum
EServerMode
18
{
19
eServerModeInvalid
= 0,
// DO NOT USE
20
eServerModeNoAuthentication
= 1,
// Don't authenticate user logins and don't list on the server list
21
eServerModeAuthentication
= 2,
// Authenticate users, list on the server list, don't run VAC on clients that connect
22
eServerModeAuthenticationAndSecure
= 3,
// Authenticate users, list on the server list and VAC protect clients
23
};
24
29
const
uint16
STEAMGAMESERVER_QUERY_PORT_SHARED
= 0xffff;
30
31
// DEPRECATED: This old name was really confusing.
32
const
uint16
MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE
=
STEAMGAMESERVER_QUERY_PORT_SHARED
;
33
34
// Initialize SteamGameServer client and interface objects, and set server properties which may not be changed.
35
//
36
// After calling this function, you should set any additional server parameters, and then
37
// call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn()
38
//
39
// - unIP will usually be zero. If you are on a machine with multiple IP addresses, you can pass a non-zero
40
// value here and the relevant sockets will be bound to that IP. This can be used to ensure that
41
// the IP you desire is the one used in the server browser.
42
// - usGamePort is the port that clients will connect to for gameplay. You will usually open up your
43
// own socket bound to this port.
44
// - usQueryPort is the port that will manage server browser related duties and info
45
// pings from clients. If you pass STEAMGAMESERVER_QUERY_PORT_SHARED for usQueryPort, then it
46
// will use "GameSocketShare" mode, which means that the game is responsible for sending and receiving
47
// UDP packets for the master server updater. (See ISteamGameServer::HandleIncomingPacket and
48
// ISteamGameServer::GetNextOutgoingPacket.)
49
// - The version string should be in the form x.x.x.x, and is used by the master server to detect when the
50
// server is out of date. (Only servers with the latest version will be listed.)
51
//
52
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL,
53
// it will receive a non-localized message that explains the reason for the failure
54
inline
ESteamAPIInitResult
SteamGameServer_InitEx
(
uint32
unIP,
uint16
usGamePort,
uint16
usQueryPort,
EServerMode
eServerMode,
const
char
*pchVersionString,
SteamErrMsg
*pOutErrMsg );
55
56
// This function is included for compatibility with older SDK.
57
// You can use it if you don't care about decent error handling
58
inline
bool
SteamGameServer_Init
(
uint32
unIP,
uint16
usGamePort,
uint16
usQueryPort,
EServerMode
eServerMode,
const
char
*pchVersionString )
59
{
60
return
SteamGameServer_InitEx
( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, NULL ) ==
k_ESteamAPIInitResult_OK
;
61
}
62
63
// Shutdown SteamGameSeverXxx interfaces, log out, and free resources.
64
S_API
void
SteamGameServer_Shutdown
();
65
66
// Most Steam API functions allocate some amount of thread-local memory for
67
// parameter storage. Calling SteamGameServer_ReleaseCurrentThreadMemory()
68
// will free all API-related memory associated with the calling thread.
69
// This memory is released automatically by SteamGameServer_RunCallbacks(),
70
// so single-threaded servers do not need to explicitly call this function.
71
inline
void
SteamGameServer_ReleaseCurrentThreadMemory
();
72
73
S_API
bool
SteamGameServer_BSecure
();
74
S_API
uint64
SteamGameServer_GetSteamID
();
75
76
// Older SDKs exported this global pointer, but it is no longer supported.
77
// You should use SteamGameServerClient() to safely access the ISteamClient
78
// APIs from your game server application.
79
//S_API ISteamClient *g_pSteamClientGameServer;
80
81
// SteamGameServer_InitSafe has been replaced with SteamGameServer_Init and
82
// is no longer supported. Use SteamGameServer_Init instead.
83
//S_API void S_CALLTYPE SteamGameServer_InitSafe();
84
85
//=============================================================================
86
//
87
// Internal implementation details below
88
//
89
//=============================================================================
90
91
S_API
ESteamAPIInitResult
S_CALLTYPE
SteamInternal_GameServer_Init_V2
(
uint32
unIP,
uint16
usGamePort,
uint16
usQueryPort,
EServerMode
eServerMode,
const
char
*pchVersionString,
const
char
*pszInternalCheckInterfaceVersions,
SteamErrMsg
*pOutErrMsg );
92
inline
ESteamAPIInitResult
SteamGameServer_InitEx
(
uint32
unIP,
uint16
usGamePort,
uint16
usQueryPort,
EServerMode
eServerMode,
const
char
*pchVersionString,
SteamErrMsg
*pOutErrMsg )
93
{
94
const
char
*pszInternalCheckInterfaceVersions =
95
STEAMUTILS_INTERFACE_VERSION
"\0"
96
STEAMNETWORKINGUTILS_INTERFACE_VERSION
"\0"
97
98
STEAMGAMESERVER_INTERFACE_VERSION
"\0"
99
STEAMGAMESERVERSTATS_INTERFACE_VERSION
"\0"
100
STEAMHTTP_INTERFACE_VERSION
"\0"
101
STEAMINVENTORY_INTERFACE_VERSION
"\0"
102
STEAMNETWORKING_INTERFACE_VERSION
"\0"
103
STEAMNETWORKINGMESSAGES_INTERFACE_VERSION
"\0"
104
STEAMNETWORKINGSOCKETS_INTERFACE_VERSION
"\0"
105
STEAMUGC_INTERFACE_VERSION
"\0"
106
"\0"
;
107
return
SteamInternal_GameServer_Init_V2
( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, pOutErrMsg );
108
}
109
inline
void
SteamGameServer_ReleaseCurrentThreadMemory
()
110
{
111
SteamAPI_ReleaseCurrentThreadMemory
();
112
}
113
114
#endif
// STEAM_GAMESERVER_H
isteamgameserver.h
STEAMGAMESERVER_INTERFACE_VERSION
#define STEAMGAMESERVER_INTERFACE_VERSION
Definition
isteamgameserver.h:269
isteamgameserverstats.h
STEAMGAMESERVERSTATS_INTERFACE_VERSION
#define STEAMGAMESERVERSTATS_INTERFACE_VERSION
Definition
isteamgameserverstats.h:63
STEAMHTTP_INTERFACE_VERSION
#define STEAMHTTP_INTERFACE_VERSION
Definition
isteamhttp.h:143
STEAMINVENTORY_INTERFACE_VERSION
#define STEAMINVENTORY_INTERFACE_VERSION
Definition
isteaminventory.h:360
STEAMNETWORKING_INTERFACE_VERSION
#define STEAMNETWORKING_INTERFACE_VERSION
Definition
isteamnetworking.h:291
STEAMNETWORKINGMESSAGES_INTERFACE_VERSION
#define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION
Definition
isteamnetworkingmessages.h:127
STEAMNETWORKINGSOCKETS_INTERFACE_VERSION
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION
Definition
isteamnetworkingsockets.h:944
STEAMNETWORKINGUTILS_INTERFACE_VERSION
#define STEAMNETWORKINGUTILS_INTERFACE_VERSION
Definition
isteamnetworkingutils.h:354
STEAMUGC_INTERFACE_VERSION
#define STEAMUGC_INTERFACE_VERSION
Definition
isteamugc.h:416
STEAMUTILS_INTERFACE_VERSION
#define STEAMUTILS_INTERFACE_VERSION
Definition
isteamutils.h:292
steam_api.h
ESteamAPIInitResult
ESteamAPIInitResult
Definition
steam_api.h:58
k_ESteamAPIInitResult_OK
@ k_ESteamAPIInitResult_OK
Definition
steam_api.h:59
SteamAPI_ReleaseCurrentThreadMemory
S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory()
S_API
#define S_API
Definition
steam_api_common.h:35
SteamErrMsg
char SteamErrMsg[k_cchMaxSteamErrMsg]
Definition
steam_api_common.h:61
uint32
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
Definition
steam_api_common.h:73
MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE
const uint16 MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE
Definition
steam_gameserver.h:32
SteamGameServer_BSecure
S_API bool SteamGameServer_BSecure()
STEAMGAMESERVER_QUERY_PORT_SHARED
const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED
Definition
steam_gameserver.h:29
EServerMode
EServerMode
Definition
steam_gameserver.h:18
eServerModeInvalid
@ eServerModeInvalid
Definition
steam_gameserver.h:19
eServerModeAuthentication
@ eServerModeAuthentication
Definition
steam_gameserver.h:21
eServerModeNoAuthentication
@ eServerModeNoAuthentication
Definition
steam_gameserver.h:20
eServerModeAuthenticationAndSecure
@ eServerModeAuthenticationAndSecure
Definition
steam_gameserver.h:22
SteamGameServer_ReleaseCurrentThreadMemory
void SteamGameServer_ReleaseCurrentThreadMemory()
Definition
steam_gameserver.h:109
SteamGameServer_Init
bool SteamGameServer_Init(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString)
Definition
steam_gameserver.h:58
SteamInternal_GameServer_Init_V2
S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg)
SteamGameServer_Shutdown
S_API void SteamGameServer_Shutdown()
SteamGameServer_GetSteamID
S_API uint64 SteamGameServer_GetSteamID()
SteamGameServer_InitEx
ESteamAPIInitResult SteamGameServer_InitEx(uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg)
Definition
steam_gameserver.h:92
uint16
unsigned short uint16
Definition
steamtypes.h:56
uint64
unsigned long long uint64
Definition
steamtypes.h:60
S_CALLTYPE
#define S_CALLTYPE
Definition
steamtypes.h:6
ThirdParty
SteamworksSDK
include
steam
steam_gameserver.h
Generated on
for Rise by
1.18.0