So that's what I was doing wrong
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ end
|
|||||||
|
|
||||||
TCP systems
|
TCP systems
|
||||||
|
|
||||||
TCPNetworkManager:
|
TCPNetworkManager: //NOPE
|
||||||
Init //opens the TCP server socket, and allocates the socket set
|
Init //opens the TCP server socket, and allocates the socket set
|
||||||
Quit //close the TCP server socket, and free the socket set
|
Quit //close the TCP server socket, and free the socket set
|
||||||
AcceptConnections //accept new connections
|
AcceptConnections //accept new connections
|
||||||
|
|||||||
@@ -22,3 +22,10 @@ If a player is in motion, the server will update their internal position, but th
|
|||||||
|
|
||||||
This outline is only the most basic example of the server's operation possible, but it's a good start. I'll need to consider things such as server-specific map data, scripts and other resources being sent to new connections.
|
This outline is only the most basic example of the server's operation possible, but it's a good start. I'll need to consider things such as server-specific map data, scripts and other resources being sent to new connections.
|
||||||
|
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
class Client:
|
||||||
|
ID --unique, incremental
|
||||||
|
socket --connection socket
|
||||||
|
[stuff]
|
||||||
|
[things]
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ public:
|
|||||||
int Send(int index, const void* data, int len);
|
int Send(int index, const void* data, int len);
|
||||||
int SendAll(const void* data, int len);
|
int SendAll(const void* data, int len);
|
||||||
|
|
||||||
int OpenSocket(const char* host, int port);
|
int AddSocket(const char* host, int port);
|
||||||
TCPsocket GetSocket(int index);
|
TCPsocket GetSocket(int index);
|
||||||
int CloseSocket(int index);
|
int CloseSocket(int index);
|
||||||
|
|
||||||
int GetMaxConnections() const;
|
int GetMaxConnections() const;
|
||||||
int GetCurrentConnections() const;
|
int GetCurrentConnections() const;
|
||||||
private:
|
private:
|
||||||
TCPsocket sock;
|
TCPsocket server;
|
||||||
SDLNet_SocketSet clientSocks;
|
SDLNet_SocketSet socketSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user