Ejemplo n.º 1
0
 void StartDash(Vector3 direction)
 {
     dashDirection += direction;
     if (dashStart == 0)
     {
         dashStart = Utils.GetTimeMilli();
         dashEnd   = dashStart + singleDashDuration;
         CSDash msg = new CSDash();
         msg.direction   = new BVector3();
         msg.direction.x = dashDirection.x;
         msg.direction.y = dashDirection.y;
         msg.direction.z = dashDirection.z;
         msg.duration    = singleDashDuration;
         MSShare.func_SendMsg(msg);
     }
     else if ((dashEnd - dashStart) <= maxDashDuration)
     {
         dashEnd = Math.Min(dashEnd + singleDashDuration, dashStart + maxDashDuration);
     }
 }
Ejemplo n.º 2
0
    public static MSMessageBase GetEmptyMessageById(int id)
    {
        MSMessageBase msg = null;

        switch (id)
        {
        case 102:
            msg = new BVector2();
            break;

        case 103:
            msg = new BVector3();
            break;

        case 101:
            msg = new BPlayer();
            break;

        case 1001:
            msg = new CSLogin();
            break;

        case 1003:
            msg = new SCJoinGame();
            break;

        case 1004:
            msg = new SCLogin();
            break;

        case 1005:
            msg = new SCGameSync();
            break;

        case 2001:
            msg = new CSMove();
            break;

        case 2002:
            msg = new SCMove();
            break;

        case 2003:
            msg = new CSJump();
            break;

        case 2004:
            msg = new SCJump();
            break;

        case 2005:
            msg = new CSDash();
            break;

        case 2006:
            msg = new SCDashStart();
            break;

        case 2007:
            msg = new SCDashStop();
            break;


        default:
            break;
        }
        return(msg);
    }