Inheritance: global::ProtoBuf.IExtensible
Beispiel #1
0
        private void EGMI_ACK_RECORD_INT(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordInt xData = new NFMsg.ObjectRecordInt();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordInt)) as NFMsg.ObjectRecordInt;

            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.SetInt(xData.property_list[i].row, xData.property_list[i].col, (int)xData.property_list[i].data);
            }
        }
        private void OnRecordInt(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectRecordInt recordData = NFMsg.ObjectRecordInt.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.SetInt(recordData.property_list[i].row, recordData.property_list[i].col, (int)recordData.property_list[i].data);
            }
        }
Beispiel #3
0
        private void OnRecordInt(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordInt recordData = new NFMsg.ObjectRecordInt();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordInt>(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.SetInt(recordData.property_list[i].row, recordData.property_list[i].col, (int)recordData.property_list[i].data);
            }
        }
        private void EGMI_ACK_RECORD_INT(MsgHead head, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectRecordInt recordData = new NFMsg.ObjectRecordInt();
            recordData = Serializer.Deserialize <NFMsg.ObjectRecordInt>(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.SetInt(recordData.property_list[i].row, recordData.property_list[i].col, (int)recordData.property_list[i].data);
            }
        }
Beispiel #5
0
        public void RequireRecordInt(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordInt xData = new NFMsg.ObjectRecordInt();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
            xData.PropertyList.Add(xRecordInt);
            xRecordInt.Row  = nRow;
            xRecordInt.Col  = nCol;
            xRecordInt.Data = newVar.IntVal();

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

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

        NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
        xData.property_list.Add(xRecordInt);
        xRecordInt.row  = nRow;
        xRecordInt.col  = nCol;
        xRecordInt.data = newVar.IntVal();

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectRecordInt>(stream, xData);
        Debug.Log("send upload record int");
        SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_INT, stream);
    }
Beispiel #7
0
        public void RequireRecordInt(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordInt xData = new NFMsg.ObjectRecordInt();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
            xData.property_list.Add(xRecordInt);
            xRecordInt.row  = nRow;
            xRecordInt.col  = nCol;
            xRecordInt.data = newVar.IntVal();

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

            Debug.Log("send upload record int");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_INT, mxBody);
        }
        private void EGMI_ACK_RECORD_INT(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectRecordInt xData = NFMsg.ObjectRecordInt.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.SetInt(xData.PropertyList[i].Row, xData.PropertyList[i].Col, (int)xData.PropertyList[i].Data);
            }
        }
		private void EGMI_ACK_RECORD_INT(MsgHead head, MemoryStream stream)
		{
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream);

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

        NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
        xData.property_list.Add(xRecordInt);
        xRecordInt.row = nRow;
        xRecordInt.col = nCol;
        xRecordInt.data = newVar.IntVal();

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