Example #1
0
 public void StopMove()
 {
     if (!HasStatus(ObjStatus.MOVE))
     {
         return;
     }
     if (Map.Instance == null || ID != Map.Instance.Player.ID)
     {
         DoStopMove();
     }
     if (Game.SinglePlayer == 0)
     {
         if (DateTime.Now.Ticks - m_lastMoveProto > 200 * 10000)
         {
             m_lastMoveProto = DateTime.Now.Ticks;
             Net.m_obj_move_tos t1 = new Net.m_obj_move_tos();
             t1.Direction = (int)(ObjDirection.STOP);
             WSocket.Send(t1);
         }
     }
     else
     {
         m_nextdirection = ObjDirection.STOP;
     }
 }
Example #2
0
 public void Move(ObjDirection direction)
 {
     if (Map.Instance == null || (Map.Instance.Player != null && ID != Map.Instance.Player.ID))
     {
         DoMove(direction);
     }
     if (HasStatus(ObjStatus.MOVE) && direction == m_direction)
     {
         return;
     }
     if (Game.SinglePlayer == 0)
     {
         if (DateTime.Now.Ticks - m_lastMoveProto > 200 * 10000)
         {
             m_lastMoveProto = DateTime.Now.Ticks;
             Net.m_obj_move_tos t1 = new Net.m_obj_move_tos();
             t1.Direction = (int)direction;
             WSocket.Send(t1);
         }
     }
     else
     {
         m_nextdirection = direction;
     }
 }
Example #3
0
 public static void ThrHeartbeat()
 {
     while (true)
     {
         m_heartbeat_tos tos = new m_heartbeat_tos();
         WSocket.Send(tos);
         Thread.Sleep(1000);
     }
 }
Example #4
0
    public static void BtnLogin()
    {
        string account = Inputmgr.GetCache("account");
        string pwd     = Inputmgr.GetCache("pwd");

        m_login_tos t1 = new m_login_tos();

        t1.Name = account;
        t1.Pwd  = MD5Helper.Md5(pwd);
        t1.Op   = (int)STATUS.LOGIN;
        WSocket.Send(t1);
    }