示例#1
0
        // Create new client
        public ClientData(Socket _clientSocket, string _name)
        {
            // Set client data
            clientSocket = _clientSocket;
            id = Server.clients.Count;
            online = true;
            name = _name;

            // Set standard spawn position
            xPos = 254.5f;
            zPos = 247.5f;
            xCurrPos = 254.5f;
            zCurrPos = 247.5f;

            // Start a thread for this client
            clientThread = new Thread(Server.ReceiveData);
            clientThread.Start(this);

            // Send packet to show the user that he connected
            PacketSender.PlayerConnected("Welcome to the server " + name, this, clientSocket);

            // Create client levels
            levels = new ClientLevels(this);
        }
示例#2
0
        public ClientData(Socket _clientSocket, string _name) // Create new client
        {
            // Set client data
            clientSocket = _clientSocket;
            id           = Server.clients.Count;
            online       = true;
            name         = _name;

            // Set standard spawn position
            xPos     = 254.5f;
            zPos     = 247.5f;
            xCurrPos = 254.5f;
            zCurrPos = 247.5f;

            // Start a thread for this client
            clientThread = new Thread(Server.ReceiveData);
            clientThread.Start(this);

            // Send packet to show the user that he connected
            PacketSender.PlayerConnected("Welcome to the server " + name, this, clientSocket);

            // Create client levels
            levels = new ClientLevels(this);
        }