상속: global::ProtoBuf.IExtensible
예제 #1
0
    public void RequireCreateRole(string strAccount, string strRoleName, int byCareer, int bySex, int nGameID)
    {
        if (strRoleName.Length >= 20 || strRoleName.Length < 1)
        {
            return;
        }

        NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
        xData.career    = byCareer;
        xData.sex       = bySex;
        xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
        xData.account   = UnicodeEncoding.Default.GetBytes(strAccount);
        xData.race      = 0;
        xData.game_id   = nGameID;

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ReqCreateRole>(stream, xData);

        SendMsg(new NFCoreEx.NFIDENTID(), NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);

        if (NFStart.Instance.bDebugMode)
        {
            NFMsg.AckRoleLiteInfoList xAckBodyData = new NFMsg.AckRoleLiteInfoList();
            NFMsg.RoleLiteInfo        info         = new NFMsg.RoleLiteInfo();

            info.career            = byCareer;
            info.sex               = bySex;
            info.noob_name         = xData.noob_name;
            info.race              = xData.race;
            info.noob_name         = xData.noob_name;
            info.id                = new NFMsg.Ident();
            info.game_id           = 1;
            info.role_level        = 1;
            info.view_record       = xData.account = UnicodeEncoding.Default.GetBytes("");
            info.delete_time       = 1;
            info.reg_time          = 1;
            info.last_offline_time = 1;
            info.last_offline_ip   = 1;
            xAckBodyData.char_data.Add(info);

            MemoryStream xAckBodyStream = new MemoryStream();
            Serializer.Serialize <NFMsg.AckRoleLiteInfoList>(xAckBodyStream, xAckBodyData);

            NFMsg.MsgBase xAckData = new NFMsg.MsgBase();
            xAckData.player_id = info.id;
            xAckData.msg_data  = xAckBodyStream.ToArray();

            MemoryStream xAckAllStream = new MemoryStream();
            Serializer.Serialize <NFMsg.MsgBase>(xAckAllStream, xAckData);

            MsgHead head = new MsgHead();
            head.unMsgID   = (UInt16)NFMsg.EGameMsgID.EGMI_ACK_ROLE_LIST;
            head.unDataLen = (UInt32)xAckAllStream.Length + (UInt32)ConstDefine.NF_PACKET_HEAD_SIZE;

            xNet.mxBinMsgEvent.OnMessageEvent(head, xAckAllStream.ToArray());
        }
    }
예제 #2
0
        public void RequireCreateRole(string strRoleName, int byCareer, int bySex)
        {
            if (strRoleName.Length >= 20 || strRoleName.Length < 1)
            {
                return;
            }

            NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
            xData.Career   = byCareer;
            xData.Sex      = bySex;
            xData.NoobName = ByteString.CopyFromUtf8(strRoleName);
            xData.Account  = ByteString.CopyFromUtf8(mAccount);
            xData.Race     = 0;

            mxBody.SetLength(0);
            xData.WriteTo(mxBody);

            mNetModule.SendMsg((int)NFMsg.EGameMsgID.ReqCreateRole, mxBody);
        }
예제 #3
0
        public void RequireCreateRole(string strAccount, string strRoleName, int byCareer, int bySex, int nGameID)
        {
            if (strRoleName.Length >= 20 || strRoleName.Length < 1)
            {
                return;
            }

            NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
            xData.career    = byCareer;
            xData.sex       = bySex;
            xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
            xData.account   = UnicodeEncoding.Default.GetBytes(strAccount);
            xData.race      = 0;
            xData.game_id   = nGameID;

            mxBody.SetLength(0);
            mxSerializer.Serialize(mxBody, xData);

            SendMsg(new NFrame.NFGUID(), NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, mxBody);
        }
예제 #4
0
        public void RequireCreateRole(string strRoleName, int byCareer, int bySex)
        {
            if (strRoleName.Length >= 20 || strRoleName.Length < 1)
            {
                return;
            }

            NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
            xData.career    = byCareer;
            xData.sex       = bySex;
            xData.noob_name = ByteString.CopyFromUtf8(strRoleName);
            xData.account   = ByteString.CopyFromUtf8(mAccount);
            xData.race      = 0;
            xData.game_id   = mServerID;

            mxBody.SetLength(0);
            xData.WriteTo(mxBody);

            mNetModule.SendMsg(NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, mxBody);
        }
예제 #5
0
        public void RequireCreateRole(string strRoleName, int byCareer, int bySex)
        {
            if (strRoleName.Length >= 20 || strRoleName.Length < 1)
            {
                return;
            }

            NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
            xData.career    = byCareer;
            xData.sex       = bySex;
            xData.noob_name = ByteString.CopyFromUtf8(strRoleName);
            xData.account   = ByteString.CopyFromUtf8(mLoginModule.mAccount);
            xData.race      = 0;
            xData.game_id   = mLoginModule.mServerID;

            MemoryStream stream = new MemoryStream();

            xData.WriteTo(stream);

            mNetModule.SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);
        }
예제 #6
0
        public void RequireCreateRole(string strRoleName, int byCareer, int bySex)
        {
            if (strRoleName.Length >= 20 || strRoleName.Length < 1)
            {
                return;
            }

            NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
            xData.career    = byCareer;
            xData.sex       = bySex;
            xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
            xData.account   = UnicodeEncoding.Default.GetBytes(NFCLoginLogic.Instance().mAccount);
            xData.race      = 0;
            xData.game_id   = NFCLoginLogic.Instance().mServerID;

            MemoryStream stream = new MemoryStream();

            Serializer.Serialize <NFMsg.ReqCreateRole>(stream, xData);

            NFCNetLogic.Instance().SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);
        }
예제 #7
0
    public void RequireCreateRole(string strAccount, string strRoleName, int byCareer, int bySex, int nGameID)
    {
        if (strRoleName.Length >= 20 || strRoleName.Length < 1)
        {
            return;
        }

        NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
        xData.career    = byCareer;
        xData.sex       = bySex;
        xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
        xData.account   = UnicodeEncoding.Default.GetBytes(strAccount);
        xData.race      = 0;
        xData.game_id   = nGameID;

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ReqCreateRole>(stream, xData);

        SendMsg(new NFCoreEx.NFIDENTID(), NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);
    }
예제 #8
0
    public void RequireCreateRole(string strAccount, string strRoleName, int byCareer, int bySex, int nGameID)
    {
        if (strRoleName.Length >= 20 || strRoleName.Length < 1)
        {
            return;
        }

        NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
        xData.career = byCareer;
        xData.sex = bySex;
        xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
        xData.account = UnicodeEncoding.Default.GetBytes(strAccount);
        xData.race = 0;
        xData.game_id = nGameID;

        MemoryStream stream = new MemoryStream();
        Serializer.Serialize<NFMsg.ReqCreateRole>(stream, xData);

        SendMsg(new NFCoreEx.NFIDENTID(), NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);
    }
예제 #9
0
    public void RequireCreateRole(string strAccount, string strRoleName, int byCareer, int bySex, int nGameID)
    {
        if (strRoleName.Length >= 20 || strRoleName.Length < 1)
        {
            return;
        }

        NFMsg.ReqCreateRole xData = new NFMsg.ReqCreateRole();
        xData.career = byCareer;
        xData.sex = bySex;
        xData.noob_name = UnicodeEncoding.Default.GetBytes(strRoleName);
        xData.account = UnicodeEncoding.Default.GetBytes(strAccount);
        xData.race = 0;
        xData.game_id = nGameID;

        MemoryStream stream = new MemoryStream();
        Serializer.Serialize<NFMsg.ReqCreateRole>(stream, xData);

        SendMsg(new NFCoreEx.NFIDENTID(), NFMsg.EGameMsgID.EGMI_REQ_CREATE_ROLE, stream);

        if (NFStart.Instance.bDebugMode)
        {
            NFMsg.AckRoleLiteInfoList xAckBodyData = new NFMsg.AckRoleLiteInfoList();
            NFMsg.RoleLiteInfo info = new NFMsg.RoleLiteInfo();

            info.career = byCareer;
            info.sex = bySex;
            info.noob_name = xData.noob_name;
            info.race = xData.race;
            info.noob_name = xData.noob_name;
            info.id = new NFMsg.Ident();
            info.game_id = 1;
            info.role_level = 1;
            info.view_record = xData.account = UnicodeEncoding.Default.GetBytes("");
            info.delete_time = 1;
            info.reg_time = 1;
            info.last_offline_time = 1;
            info.last_offline_ip = 1;
            xAckBodyData.char_data.Add(info);

            MemoryStream xAckBodyStream = new MemoryStream();
            Serializer.Serialize<NFMsg.AckRoleLiteInfoList>(xAckBodyStream, xAckBodyData);

            NFMsg.MsgBase xAckData = new NFMsg.MsgBase();
            xAckData.player_id = info.id;
            xAckData.msg_data = xAckBodyStream.ToArray();

            MemoryStream xAckAllStream = new MemoryStream();
            Serializer.Serialize<NFMsg.MsgBase>(xAckAllStream, xAckData);

            MsgHead head = new MsgHead();
            head.unMsgID = (UInt16)NFMsg.EGameMsgID.EGMI_ACK_ROLE_LIST;
            head.unDataLen = (UInt32)xAckAllStream.Length + (UInt32)ConstDefine.NF_PACKET_HEAD_SIZE;

            xNet.mxBinMsgEvent.OnMessageEvent(head, xAckAllStream.ToArray());
        }
    }