Property | Type | Description | |
---|---|---|---|
SERVER_IP | string | ||
matchID | string | ||
socket | |||
username | string |
Method | Description | |
---|---|---|
NetworkClient ( string matchID, string username, string ip ) : System |
The component that the game logic uses to creates the instance of our class.
|
|
OnApplicationQuit ( ) : void |
Quits the client and closes the socket and stops the threads. Must have this otherwise Unity will freeze after running the application more than once.
|
|
SendInstruction ( |
Sends an instruction to the server. It's in a lock (using monitor lock) to prevent multiple sending instructions at the same time.
|
|
Start ( ) : void |
Starts the new thread that will call the client to start.
|
public NetworkClient ( string matchID, string username, string ip ) : System | ||
matchID | string | The MatchID of the client. It is 20 characters separated with a dash every 4 characters. |
username | string | The username of the client. |
ip | string | |
return | System |
public SendInstruction ( |
||
command | The type of instruction to send. | |
arg1 | string | An argument to pass along with the instruction. |
arg2 | string | An argument to pass along with the instruction. |
arg3 | string | An argument to pass along with the instruction. |
arg4 | string | An argument to pass along with the instruction. |
return | void |
public UdpClient,System.Net.Sockets socket | ||
return |