fixed networking
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "input.h"
|
||||
#include "mainmenu.h"
|
||||
#include "networking.h"
|
||||
#include "steam/steam_api_common.h"
|
||||
#include "tier0/network.h"
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/commandline.h"
|
||||
@@ -94,6 +95,11 @@ void IEngine::Init()
|
||||
#endif
|
||||
|
||||
#ifdef STEAM_ENABLED
|
||||
if(SteamAPI_RestartAppIfNecessary(480))
|
||||
{
|
||||
Plat_Exit(0);
|
||||
}
|
||||
|
||||
SteamErrMsg err;
|
||||
if (SteamAPI_InitEx(&err) != k_ESteamAPIInitResult_OK)
|
||||
{
|
||||
@@ -143,6 +149,9 @@ void IEngine::Init()
|
||||
//-----------------------------------------------------------------------------
|
||||
void IEngine::Frame(float fDelta)
|
||||
{
|
||||
#ifdef STEAM_ENABLED
|
||||
SteamAPI_RunCallbacks();
|
||||
#endif
|
||||
IServer::Think(fDelta);
|
||||
|
||||
if (INetworking::IsClient())
|
||||
|
||||
@@ -75,6 +75,7 @@ void INetworking::Init()
|
||||
#ifdef STEAMNETWORKINGSOCKETS_OPENSOURCE
|
||||
GameNetworkingSockets_Init(NULL, &errMsg)
|
||||
#endif
|
||||
V_printf("Cool\n");
|
||||
if (ICommandLine::CheckParam("-steamdebug"))
|
||||
{
|
||||
SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Msg,
|
||||
@@ -113,7 +114,6 @@ void INetworking::Init()
|
||||
net_listenSocket = SteamGameServerNetworkingSockets()->CreateListenSocketP2P(0, 0, NULL);
|
||||
net_bIsServer = true;
|
||||
} else {
|
||||
V_printf("Cool\n");
|
||||
if (ICommandLine::ParamValue("-connect"))
|
||||
{
|
||||
Console()->AddCommand(CUtlString("connect %s;", ICommandLine::ParamValue("-connect")));
|
||||
@@ -166,7 +166,6 @@ void INetworking::Frame()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SteamNetworkingSockets()->RunCallbacks();
|
||||
SteamNetworkingMessage_t *pMessages[64];
|
||||
while (true)
|
||||
{
|
||||
|
||||
@@ -3,4 +3,4 @@ bind a +left;
|
||||
bind d +right;
|
||||
bind w +forward;
|
||||
bind s +back;
|
||||
bind o connect 90271142097538072;
|
||||
bind o connect 90271429367739416;
|
||||
|
||||
Reference in New Issue
Block a user