GlobalMerge2
This commit is contained in:
parent
898b734c9e
commit
48f43baf2f
1 changed files with 13 additions and 5 deletions
|
@ -28,6 +28,12 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
|
||||
}
|
||||
|
||||
public void StopConnection()
|
||||
{
|
||||
socket.Shutdown(SocketShutdown.Both);
|
||||
socket.Close();
|
||||
}
|
||||
|
||||
public void JoinRoom() // multyplayer
|
||||
{
|
||||
SendData();
|
||||
|
@ -45,11 +51,13 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
{
|
||||
socket.Connect(endPoint);
|
||||
|
||||
byte[] bytes = new byte[2048];
|
||||
|
||||
var countAnsw = socket.Receive(bytes);
|
||||
|
||||
string updates = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновления отосланные сервером
|
||||
while(socket.Connected)
|
||||
{
|
||||
byte[] bytes = new byte[2048];
|
||||
var countAnsw = socket.Receive(bytes);
|
||||
string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером
|
||||
GetDataSent(update);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue