Inheritance: global::ProtoBuf.IExtensible
Esempio n. 1
0
        private void EGMI_ACK_RECORD_OBJECT(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordObject)) as NFMsg.ObjectRecordObject;

            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.SetObject(xData.property_list[i].row, xData.property_list[i].col, NFNetController.PBToNF(xData.property_list[i].data));
            }
        }
Esempio n. 2
0
        private void OnRecordObject(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectRecordObject recordData = NFMsg.ObjectRecordObject.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.SetObject(recordData.property_list[i].row, recordData.property_list[i].col, mHelpModule.PBToNF(recordData.property_list[i].data));
            }
        }
Esempio n. 3
0
        private void OnRecordObject(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordObject recordData = new NFMsg.ObjectRecordObject();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordObject>(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.SetObject(recordData.property_list[i].row, recordData.property_list[i].col, mHelpModule.PBToNF(recordData.property_list[i].data));
            }
        }
Esempio n. 4
0
        public void RequireRecordObject(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
            xData.PropertyList.Add(xRecordObject);
            xRecordObject.Row  = nRow;
            xRecordObject.Col  = nCol;
            xRecordObject.Data = mHelpModule.NFToPB(newVar.ObjectVal());

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

            Debug.Log("send upload record object");
            SendMsg((int)NFMsg.EGameMsgID.AckRecordObject, mxBody);
        }
    public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
        xData.player_id   = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
        xData.property_list.Add(xRecordObject);
        xRecordObject.row  = nRow;
        xRecordObject.col  = nCol;
        xRecordObject.data = NFBinarySendLogic.NFToPB(newVar.ObjectVal());

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordObject>(stream, xData);
        Debug.Log("send upload record object");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_OBJECT, stream);
    }
Esempio n. 6
0
        public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
            xData.property_list.Add(xRecordObject);
            xRecordObject.row  = nRow;
            xRecordObject.col  = nCol;
            xRecordObject.data = NFNetController.NFToPB(newVar.ObjectVal());

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

            Debug.Log("send upload record object");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_OBJECT, mxBody);
        }
Esempio n. 7
0
        private void EGMI_ACK_RECORD_OBJECT(MsgHead head, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordObject recordData = new NFMsg.ObjectRecordObject();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordObject>(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.SetObject(recordData.property_list[i].row, recordData.property_list[i].col, PBToNF(recordData.property_list[i].data));
            }
        }
        private void EGMI_ACK_RECORD_OBJECT(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

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

            NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(xData.PlayerId));

            if (go == null)
            {
                Debug.LogError("error id" + xData.PlayerId);
                return;
            }

            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(xData.RecordName.ToStringUtf8());

            for (int i = 0; i < xData.PropertyList.Count; i++)
            {
                record.SetObject(xData.PropertyList[i].Row, xData.PropertyList[i].Col, mHelpModule.PBToNF(xData.PropertyList[i].Data));
            }
        }
Esempio n. 9
0
		private void EGMI_ACK_RECORD_OBJECT(MsgHead head, MemoryStream stream)
		{
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream);

			NFMsg.ObjectRecordObject recordData = new NFMsg.ObjectRecordObject();
            recordData = Serializer.Deserialize<NFMsg.ObjectRecordObject>(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.SetObject(recordData.property_list[i].row, recordData.property_list[i].col, PBToNF(recordData.property_list[i].data));
            }
		}
Esempio n. 10
0
    public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFIDataList.TData newVar)
    {
        NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
        xData.player_id = NFBinarySendLogic.NFToPB(self);
        xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

        NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
        xData.property_list.Add(xRecordObject);
        xRecordObject.row = nRow;
        xRecordObject.col = nCol;
        xRecordObject.data = NFBinarySendLogic.NFToPB(newVar.ObjectVal());

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