void Awake() { if (serverIP == "") { Debug.LogError("Server IP Address not set"); } if (port == -1) { Debug.LogError("Port not set"); } packetNumber = 0; desiredPosition = transform.position; otherClientMover = GetComponent <NetworkClientDisplay>(); otherClients = new Dictionary <string, GameObject>(); history = new Dictionary <int, StateHistory>(); endPoint = new IPEndPoint(IPAddress.Parse(serverIP), port); udp = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); udp.Blocking = false; // n stands for new user // server will reply with a unique id for this user SendInitialReqToServer(); history.Add(0, new StateHistory(transform.position)); }
void Start() { client = GetComponent <NetworkClient>(); clientMover = GetComponent <NetworkClientDisplay>(); }