Ejemplo n.º 1
0
    private void OnButton_Binary_SendMsg()
    {
        ByteStreamBuff _tmpbuff = new ByteStreamBuff();

        _tmpbuff.Write_Int(1314);
        _tmpbuff.Write_Float(99.99f);
        _tmpbuff.Write_UniCodeString("Claine");
        _tmpbuff.Write_UniCodeString("123456");
        SocketManager.Instance.SendMsg(eProtocalCommand.sc_binary_login, _tmpbuff);
    }
Ejemplo n.º 2
0
    public void sendFromatToServer(int flag, byte dire)
    {
        ByteStreamBuff _tmpbuff = new ByteStreamBuff();

        /*_tmpbuff.Write_Int(1314);
         * _tmpbuff.Write_Float(99.99f);
         * _tmpbuff.Write_UniCodeString("Claine");
         * _tmpbuff.Write_UniCodeString("123456");
         * SocketManager.Instance.SendMsg(eProtocalCommand.sc_binary_login, _tmpbuff);*/

        switch (flag)
        {
        case MAP_FLAG:
            _tmpbuff.Write_Byte(MAP_FLAG);
            break;

        case JION_IN:
            _tmpbuff.Write_Byte(JION_IN);
            break;

        case TURN_FLAG:
            _tmpbuff.Write_Byte(TURN_FLAG);
            _tmpbuff.Write_Byte(dire);
            break;

        case GAME_STATE_FLAG:
            _tmpbuff.Write_Byte(GAME_STATE_FLAG);
            _tmpbuff.Write_Int(1);
            break;

        default:
            break;
        }

        SocketManager.Instance.SendMsg(_tmpbuff);

        return;
    }