@@ -3,7 +3,6 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
@@ -20,7 +19,6 @@ public class Client
|
||||
private UdpClient client;
|
||||
private int port;
|
||||
private Thread receiveThread;
|
||||
private string nameOther = null;
|
||||
|
||||
public Client(string hostname, int port, World world, string name)
|
||||
{
|
||||
@@ -238,19 +236,6 @@ public class Client
|
||||
|
||||
world.UpdatePlayerRotation(new Quaternion(x, y, z, w), id);
|
||||
}
|
||||
|
||||
//name request
|
||||
if (data[0] == 11)
|
||||
{
|
||||
List<byte> nameASCII = new List<byte>();
|
||||
|
||||
for (int i = 1; i < data.Length; i++)
|
||||
{
|
||||
nameASCII.Add(data[i]);
|
||||
}
|
||||
|
||||
nameOther = Encoding.ASCII.GetString(nameASCII.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -280,19 +265,6 @@ public class Client
|
||||
client.Send(data, data.Length);
|
||||
}
|
||||
|
||||
public string GetPlayerName(int id)
|
||||
{
|
||||
Send(new byte[]{11, (byte)id});
|
||||
|
||||
while (nameOther == null)
|
||||
{
|
||||
}
|
||||
|
||||
string ret = nameOther;
|
||||
nameOther = null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void SaveWorld()
|
||||
{
|
||||
Send(new byte[]{9});
|
||||
|
||||
Reference in New Issue
Block a user