Esempio n. 1
0
        /// <summary>
        /// Start this instance.
        /// </summary>
        public void Start()
        {
            try
            {
                pos = new double[3] { 0, 72, 0 };
                //oldpos = new double[3] { 0, 0, 0 };
                rot = new float[2] { 0,0 };
                Stance = 72;

                e = new Entity(this, Server.mainlevel);

                ip = socket.RemoteEndPoint.ToString().Split(':')[0];

                inventory = new Inventory(this);
                players.Add(this);
                //Event --------------------
                if (PlayerConnect != null)
                    PlayerConnect(this);
                //Event --------------------
                socket.BeginReceive(tempbuffer, 0, tempbuffer.Length, SocketFlags.None, new AsyncCallback(Receive), this);
            }
            catch (Exception e)
            {
                Server.Log(e.Message);
                Server.Log(e.StackTrace);
            }
        }
Esempio n. 2
0
 public void Start()
 {
     try
     {
         level = Server.mainlevel;
         e = new Entity(new double[3] { 0, 18, 0 }, new float[2] { 0, 0 }, this);
         pos[1] = 128;
         Stance = 128;
         //socket = s;
         ip = socket.RemoteEndPoint.ToString().Split(':')[0];
         Server.Log(ip + " connected to the server.");
         dimension = 0;
         inventory = new Inventory();
         players.Add(this);
         //Event --------------------
         if (PlayerConnect != null)
             PlayerConnect(this);
         //Event --------------------
         socket.BeginReceive(tempbuffer, 0, tempbuffer.Length, SocketFlags.None, new AsyncCallback(Receive), this);
     }
     catch (Exception e)
     {
         Server.Log(e.Message);
         Server.Log(e.StackTrace);
     }
 }