naming
This commit is contained in:
@@ -44,9 +44,9 @@
|
|||||||
modules/NetworkingModule/src/*.cpp \
|
modules/NetworkingModule/src/*.cpp \
|
||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include \
|
-I src -I include \
|
||||||
|
-I ${pkgs.gamenetworkingsockets}/include/GameNetworkingSockets \
|
||||||
|
-lGameNetworkingSockets \
|
||||||
-DNETWORKINGMODULE_DYNAMIC \
|
-DNETWORKINGMODULE_DYNAMIC \
|
||||||
-lGameNetworkingSockets
|
|
||||||
-lGL -lglfw -lGLEW \
|
|
||||||
-Wall \
|
-Wall \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|||||||
21
modules/ClientModule/src/ClientModule.cpp
Normal file
21
modules/ClientModule/src/ClientModule.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include "ClientModule.h"
|
||||||
|
|
||||||
|
ClientModule::ClientModule(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
|
||||||
|
name = "ClientModule";
|
||||||
|
}
|
||||||
|
|
||||||
|
ClientModule::~ClientModule() {
|
||||||
|
GameNetworkingSockets_Kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientModule::onLoad() {
|
||||||
|
SteamDatagramErrMsg errMsg;
|
||||||
|
if ( !GameNetworkingSockets_Init( nullptr, errMsg ) ) {
|
||||||
|
//FatalError( "GameNetworkingSockets_Init failed. %s", errMsg );
|
||||||
|
std::cerr << "GameNetworkingSockets_Init() Failed: " << errMsg << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//g_logTimeZero = SteamNetworkingUtils()->GetLocalTimestamp();
|
||||||
|
|
||||||
|
//SteamNetworkingUtils()->SetDebugOutputFunction( k_ESteamNetworkingSocketsDebugOutputType_Msg, DebugOutput );
|
||||||
|
}
|
||||||
24
modules/ClientModule/src/ClientModule.h
Normal file
24
modules/ClientModule/src/ClientModule.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#include "Archimedes.h"
|
||||||
|
|
||||||
|
#include <steam/steamnetworkingsockets.h>
|
||||||
|
#include <steam/isteamnetworkingutils.h>
|
||||||
|
|
||||||
|
class ClientModule : public Archimedes::Module {
|
||||||
|
|
||||||
|
public:
|
||||||
|
ClientModule(Archimedes::App*, void*);
|
||||||
|
~ClientModule();
|
||||||
|
void onLoad();
|
||||||
|
void run();
|
||||||
|
|
||||||
|
void startClient(std::string);
|
||||||
|
void startServer(unsigned int);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef CLIENTMODULE_DYNAMIC
|
||||||
|
#define MODULE_TYPE ClientModule
|
||||||
|
#include "endModule.h"
|
||||||
|
#endif
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#include "NetworkingModule.h"
|
|
||||||
|
|
||||||
NetworkingModule::NetworkingModule(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
|
|
||||||
name = "NetworkingModule";
|
|
||||||
}
|
|
||||||
|
|
||||||
NetworkingModule::~NetworkingModule() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetworkingModule::onLoad() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetworkingModule::run() {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#include "Archimedes.h"
|
|
||||||
|
|
||||||
#include <steam/steamnetworkingsockets.h>
|
|
||||||
#include <steam/isteamnetworkingutils.h>
|
|
||||||
|
|
||||||
class NetworkingModule : public Archimedes::Module {
|
|
||||||
|
|
||||||
public:
|
|
||||||
NetworkingModule(Archimedes::App*, void*);
|
|
||||||
~NetworkingModule();
|
|
||||||
void run();
|
|
||||||
void onLoad();
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef NETWORKINGMODULE_DYNAMIC
|
|
||||||
#define MODULE_TYPE NetworkingModule
|
|
||||||
#include "endModule.h"
|
|
||||||
#endif
|
|
||||||
21
modules/ServerModule/src/ServerModule.cpp
Normal file
21
modules/ServerModule/src/ServerModule.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include "ServerModule.h"
|
||||||
|
|
||||||
|
ServerModule::ServerModule(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
|
||||||
|
name = "ServerModule";
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerModule::~ServerModule() {
|
||||||
|
GameNetworkingSockets_Kill();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerModule::onLoad() {
|
||||||
|
SteamDatagramErrMsg errMsg;
|
||||||
|
if ( !GameNetworkingSockets_Init( nullptr, errMsg ) ) {
|
||||||
|
//FatalError( "GameNetworkingSockets_Init failed. %s", errMsg );
|
||||||
|
std::cerr << "GameNetworkingSockets_Init() Failed: " << errMsg << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//g_logTimeZero = SteamNetworkingUtils()->GetLocalTimestamp();
|
||||||
|
|
||||||
|
//SteamNetworkingUtils()->SetDebugOutputFunction( k_ESteamNetworkingSocketsDebugOutputType_Msg, DebugOutput );
|
||||||
|
}
|
||||||
24
modules/ServerModule/src/ServerModule.h
Normal file
24
modules/ServerModule/src/ServerModule.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#include "Archimedes.h"
|
||||||
|
|
||||||
|
#include <steam/steamnetworkingsockets.h>
|
||||||
|
#include <steam/isteamnetworkingutils.h>
|
||||||
|
|
||||||
|
class ServerModule : public Archimedes::Module {
|
||||||
|
|
||||||
|
public:
|
||||||
|
ServerModule(Archimedes::App*, void*);
|
||||||
|
~ServerModule();
|
||||||
|
void onLoad();
|
||||||
|
void run();
|
||||||
|
|
||||||
|
void startClient(std::string);
|
||||||
|
void startServer(unsigned int);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SERVERMODULE_DYNAMIC
|
||||||
|
#define MODULE_TYPE ServerModule
|
||||||
|
#include "endModule.h"
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user