Inheritance: global::ProtoBuf.IExtensible
コード例 #1
0
        private void OnPropertyString(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectPropertyString propertyData = new NFMsg.ObjectPropertyString();
            propertyData = Serializer.Deserialize <NFMsg.ObjectPropertyString>(new MemoryStream(xMsg.msg_data));

            NFIObject go = NFCKernelModule.Instance().GetObject(PBToNF(propertyData.player_id));

            for (int i = 0; i < propertyData.property_list.Count; i++)
            {
                NFIPropertyManager propertyManager = go.GetPropertyManager();
                NFIProperty        property        = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name));
                if (null == property)
                {
                    NFIDataList varList = new NFCDataList();
                    varList.AddString("");

                    property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name), varList);
                }

                property.SetString(System.Text.Encoding.Default.GetString(propertyData.property_list[i].data));
            }
        }
コード例 #2
0
        private void EGMI_ACK_PROPERTY_STRING(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

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

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

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

            NFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < xData.PropertyList.Count; i++)
            {
                string name = xData.PropertyList[i].PropertyName.ToStringUtf8();
                string data = xData.PropertyList[i].Data.ToStringUtf8();

                NFIProperty property = propertyManager.GetProperty(name);
                if (null == property)
                {
                    NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                    property = propertyManager.AddProperty(name, var);
                }

                property.SetString(data);
            }
        }
コード例 #3
0
        private void EGMI_ACK_PROPERTY_STRING(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectPropertyString)) as NFMsg.ObjectPropertyString;

            NFIObject go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xData.player_id));

            if (go == null)
            {
                return;
            }

            for (int i = 0; i < xData.property_list.Count; i++)
            {
                NFIPropertyManager propertyManager = go.GetPropertyManager();
                NFIProperty        property        = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(xData.property_list[i].property_name));
                if (null == property)
                {
                    NFDataList varList = new NFDataList();
                    varList.AddString("");

                    property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(xData.property_list[i].property_name), varList);
                }

                property.SetString(System.Text.Encoding.Default.GetString(xData.property_list[i].data));
            }
        }
コード例 #4
0
ファイル: NFNetModule.cs プロジェクト: isoundy000/NFUnitySDK
        public void RequirePropertyString(NFGUID objectID, string strPropertyName, string newVar)
        {
            NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
            xData.PlayerId = mHelpModule.NFToPB(objectID);

            NFMsg.PropertyString xPropertyString = new NFMsg.PropertyString();
            xPropertyString.PropertyName = ByteString.CopyFromUtf8(strPropertyName);
            xPropertyString.Data         = ByteString.CopyFromUtf8(newVar);
            xData.PropertyList.Add(xPropertyString);

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

            Debug.Log("send upload String");
            SendMsg((int)NFMsg.EGameMsgID.AckPropertyString, mxBody);
        }
コード例 #5
0
    public void RequirePropertyString(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyString xPropertyString = new NFMsg.PropertyString();
        xPropertyString.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xPropertyString.data          = System.Text.Encoding.Default.GetBytes(newVar.StringVal());
        xData.property_list.Add(xPropertyString);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectPropertyString>(stream, xData);
        Debug.Log("send upload String");
        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_STRING, stream);
    }
コード例 #6
0
        public void RequirePropertyString(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyString xPropertyString = new NFMsg.PropertyString();
            xPropertyString.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyString.data          = System.Text.Encoding.Default.GetBytes(newVar.StringVal());
            xData.property_list.Add(xPropertyString);

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

            Debug.Log("send upload String");
            NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_STRING, mxBody);
        }
コード例 #7
0
        private void OnPropertyString(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyString propertyData = NFMsg.ObjectPropertyString.Parser.ParseFrom(xMsg.msg_data);

            NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(propertyData.player_id));

            for (int i = 0; i < propertyData.property_list.Count; i++)
            {
                NFIPropertyManager propertyManager = go.GetPropertyManager();
                NFIProperty        property        = propertyManager.GetProperty(propertyData.property_list[i].property_name.ToStringUtf8());
                if (null == property)
                {
                    NFDataList varList = new NFDataList();
                    varList.AddString("");

                    property = propertyManager.AddProperty(propertyData.property_list[i].property_name.ToStringUtf8(), varList);
                }

                property.SetString(propertyData.property_list[i].data.ToStringUtf8());
            }
        }
コード例 #8
0
		private void EGMI_ACK_PROPERTY_STRING(MsgHead head, MemoryStream stream)
		{
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream);

			NFMsg.ObjectPropertyString propertyData = new NFMsg.ObjectPropertyString();
            propertyData = Serializer.Deserialize<NFMsg.ObjectPropertyString>(new MemoryStream(xMsg.msg_data));

            NFIObject go = NFCKernelModule.Instance.GetObject(PBToNF(propertyData.player_id));

			for(int i = 0; i < propertyData.property_list.Count; i++)
			{
                NFIPropertyManager propertyManager = go.GetPropertyManager();
                NFIProperty property = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name));
                if (null == property)
                {
                    NFIDataList varList = new NFCDataList();
                    varList.AddString("");

                    property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name), varList);
                }

                property.SetString(System.Text.Encoding.Default.GetString(propertyData.property_list[i].data));
			}
		}
コード例 #9
0
    public void RequirePropertyString(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyString xData = new NFMsg.ObjectPropertyString();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyString xPropertyString = new NFMsg.PropertyString();
        xPropertyString.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xPropertyString.data = System.Text.Encoding.Default.GetBytes(newVar.StringVal());
        xData.property_list.Add(xPropertyString);

        MemoryStream stream = new MemoryStream();
        Serializer.Serialize<NFMsg.ObjectPropertyString>(stream, xData);
        Debug.Log("send upload String");
        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_STRING, stream);
    }