22 #ifndef SCUMM_HE_NET_MAIN_H 23 #define SCUMM_HE_NET_MAIN_H 25 #include "backends/networking/enet/enet.h" 26 #include "backends/networking/enet/host.h" 27 #include "backends/networking/enet/socket.h" 28 #include "common/formats/json.h" 31 class ScummEngine_v90he;
35 Net(ScummEngine_v90he *vm);
45 bool operator==(
const Address &other) {
46 return host == other.host && port == other.port;
62 uint8 mapGenerator = 0;
71 bool getGeneratedMap =
false;
97 int hostGame(
char *sessionName,
char *userName);
118 int addUser(
char *shortName,
char *longName);
334 void remoteStartScript(
int typeOfSend,
int sendTypeParam,
int priority,
int argsCount, int32 *args);
343 void remoteSendArray(
int typeOfSend,
int sendTypeParam,
int priority,
int arrayIndex);
359 int remoteStartScriptFunction(
int typeOfSend,
int sendTypeParam,
int priority,
int defaultReturnValue,
int argsCount, int32 *args);
381 bool connectToSession(
Common::String address,
int port,
bool queryGeneratedMap);
393 int doJoinSession(Session session);
401 void generateMoonbaseMap(Session session);
416 int remoteSendData(
int typeOfSend,
int sendTypeParam,
int type,
Common::String data,
int priority,
int defaultRes = 0,
bool wait =
false,
int callid = 0);
424 bool serviceBroadcast();
436 void serviceSessionServer();
446 void remoteReceiveData();
489 bool getIPfromName(
char *ip,
int ipLength,
char *nameBuffer);
522 int getTotalPlayers();
537 ScummEngine_v90he *_vm;
568 bool _isShuttingDown;
581 Address _sessionServerAddress;
584 int _sessionServerPeer;
585 bool _isRelayingGame;
void getSessionName(int sessionNumber, char *buffer, int length)
void getProviderName(int providerIndex, char *buffer, int length)
Get the name of a provider of the given index.
int32 updateQuerySessions()
void enableSessionJoining()
bool getHostName(char *hostname, int length)
void doNetworkOnceAFrame(int msecs)
int getSessionPlayerCount(int sessionNumber)
Definition: net_main.h:33
void setSessionServer(Common::String sessionServer)
int setProvider(int providerIndex)
Set the provider by the index.
int joinSessionById(int sessionId)
int joinSession(int sessionIndex)
int joinGame(Common::String IP, char *userName)
int ifSessionExist(int sessionId)
void setFakeLatency(int time)
Sets the fake latency.
void setBotsCount(int botsCount)
Set AI Player count.
int32 setProviderByName(int32 parameter1, int32 parameter2)
Set and initializes the provider given by their name.
void remoteSendArray(int typeOfSend, int sendTypeParam, int priority, int arrayIndex)
int createSession(char *name)
Creates and host a network game session.
void disableSessionJoining()
bool getIPfromName(char *ip, int ipLength, char *nameBuffer)
bool destroyPlayer(int32 userId)
int32 startQuerySessions(bool connectToSessionServer=true)
int addUser(char *shortName, char *longName)
int hostGame(char *sessionName, char *userName)
void remoteStartScript(int typeOfSend, int sendTypeParam, int priority, int argsCount, int32 *args)
int remoteStartScriptFunction(int typeOfSend, int sendTypeParam, int priority, int defaultReturnValue, int argsCount, int32 *args)