Inheritance: global::ProtoBuf.IExtensible
コード例 #1
0
ファイル: NFMsgListener.cs プロジェクト: zh423328/NFClient
        private void EGMI_ACK_RECORD_STRING(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordString)) as NFMsg.ObjectRecordString;

            NFIObject        go            = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(System.Text.Encoding.Default.GetString(xData.record_name));

            for (int i = 0; i < xData.property_list.Count; i++)
            {
                record.SetString(xData.property_list[i].row, xData.property_list[i].col, System.Text.Encoding.Default.GetString(xData.property_list[i].data));
            }
        }
コード例 #2
0
        private void EGMI_ACK_RECORD_STRING(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectRecordString xData = NFMsg.ObjectRecordString.Parser.ParseFrom(xMsg.MsgData);

            NFIObject        go            = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(xData.RecordName.ToStringUtf8());

            for (int i = 0; i < xData.PropertyList.Count; i++)
            {
                record.SetString(xData.PropertyList[i].Row, xData.PropertyList[i].Col, xData.PropertyList[i].Data.ToStringUtf8());
            }
        }
コード例 #3
0
        private void OnRecordString(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectRecordString recordData = NFMsg.ObjectRecordString.Parser.ParseFrom(xMsg.msg_data);

            NFIObject        go            = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(recordData.record_name.ToStringUtf8());

            for (int i = 0; i < recordData.property_list.Count; i++)
            {
                record.SetString(recordData.property_list[i].row, recordData.property_list[i].col, recordData.property_list[i].data.ToStringUtf8());
            }
        }
コード例 #4
0
        private void OnRecordString(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordString recordData = new NFMsg.ObjectRecordString();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordString>(new MemoryStream(xMsg.msg_data));

            NFIObject        go            = mKernelModule.GetObject(mHelpModule.PBToNF(recordData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(System.Text.Encoding.Default.GetString(recordData.record_name));

            for (int i = 0; i < recordData.property_list.Count; i++)
            {
                record.SetString(recordData.property_list[i].row, recordData.property_list[i].col, System.Text.Encoding.Default.GetString(recordData.property_list[i].data));
            }
        }
コード例 #5
0
        private void EGMI_ACK_RECORD_STRING(MsgHead head, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordString recordData = new NFMsg.ObjectRecordString();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordString>(new MemoryStream(xMsg.msg_data));

            NFIObject        go            = NFCKernel.Instance.GetObject(PBToNF(recordData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(System.Text.Encoding.Default.GetString(recordData.record_name));

            for (int i = 0; i < recordData.property_list.Count; i++)
            {
                record.SetString(recordData.property_list[i].row, recordData.property_list[i].col, System.Text.Encoding.Default.GetString(recordData.property_list[i].data));
            }
        }
コード例 #6
0
ファイル: NFNetModule.cs プロジェクト: isoundy000/NFUnitySDK
        public void RequireRecordString(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordString xRecordString = new NFMsg.RecordString();
            xData.PropertyList.Add(xRecordString);
            xRecordString.Row  = nRow;
            xRecordString.Col  = nCol;
            xRecordString.Data = ByteString.CopyFromUtf8(newVar.StringVal());

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

            Debug.Log("send upload record string");
            SendMsg((int)NFMsg.EGameMsgID.AckRecordString, mxBody);
        }
コード例 #7
0
    public void RequireRecordString(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordString xRecordString = new NFMsg.RecordString();
        xData.property_list.Add(xRecordString);
        xRecordString.row  = nRow;
        xRecordString.col  = nCol;
        xRecordString.data = System.Text.Encoding.Default.GetBytes(newVar.StringVal());

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordString>(stream, xData);
        Debug.Log("send upload record string");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_STRING, stream);
    }
コード例 #8
0
        public void RequireRecordString(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordString xRecordString = new NFMsg.RecordString();
            xData.property_list.Add(xRecordString);
            xRecordString.row  = nRow;
            xRecordString.col  = nCol;
            xRecordString.data = System.Text.Encoding.Default.GetBytes(newVar.StringVal());

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

            Debug.Log("send upload record string");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_STRING, mxBody);
        }
コード例 #9
0
		private void EGMI_ACK_RECORD_STRING(MsgHead head, MemoryStream stream)
		{
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream);

			NFMsg.ObjectRecordString recordData = new NFMsg.ObjectRecordString();
            recordData = Serializer.Deserialize<NFMsg.ObjectRecordString>(new MemoryStream(xMsg.msg_data));

            NFIObject go = NFCKernelModule.Instance.GetObject(PBToNF(recordData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord record = recordManager.GetRecord(System.Text.Encoding.Default.GetString(recordData.record_name));

            for (int i = 0; i < recordData.property_list.Count; i++)
            {
                record.SetString(recordData.property_list[i].row, recordData.property_list[i].col, System.Text.Encoding.Default.GetString(recordData.property_list[i].data));
            }
		}
コード例 #10
0
    public void RequireRecordString(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordString xData = new NFMsg.ObjectRecordString();
        xData.player_id = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordString xRecordString = new NFMsg.RecordString();
        xData.property_list.Add(xRecordString);
        xRecordString.row = nRow;
        xRecordString.col = nCol;
        xRecordString.data = System.Text.Encoding.Default.GetBytes(newVar.StringVal());

        MemoryStream stream = new MemoryStream();
        Serializer.Serialize<NFMsg.ObjectRecordString>(stream, xData);
        Debug.Log("send upload record string");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_STRING, stream);
    }