Inheritance: global::ProtoBuf.IExtensible
Ejemplo n.º 1
0
        private void OnPropertyFloat(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectPropertyFloat propertyData = new NFMsg.ObjectPropertyFloat();
            propertyData = Serializer.Deserialize <NFMsg.ObjectPropertyFloat>(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.AddFloat(0.0f);

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

                property.SetFloat(propertyData.property_list[i].data);
            }
        }
Ejemplo n.º 2
0
        private void EGMI_ACK_PROPERTY_FLOAT(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

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

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

            if (go == null)
            {
                return;
            }

            NFIPropertyManager propertyManager = go.GetPropertyManager();

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

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

                property.SetFloat(data);
            }
        }
Ejemplo n.º 3
0
        private void EGMI_ACK_PROPERTY_FLOAT(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectPropertyFloat xData = new NFMsg.ObjectPropertyFloat();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectPropertyFloat)) as NFMsg.ObjectPropertyFloat;

            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.AddFloat(0.0f);

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

                property.SetFloat(xData.property_list[i].data);
            }
        }
Ejemplo n.º 4
0
        public void RequirePropertyFloat(NFGUID objectID, string strPropertyName, float newVar)
        {
            NFMsg.ObjectPropertyFloat xData = new NFMsg.ObjectPropertyFloat();
            xData.PlayerId = mHelpModule.NFToPB(objectID);

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

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

            Debug.Log("send upload Float");
            SendMsg((int)NFMsg.EGameMsgID.AckPropertyFloat, mxBody);
        }
Ejemplo n.º 5
0
    public void RequirePropertyFloat(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyFloat xData = new NFMsg.ObjectPropertyFloat();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyFloat xPropertyFloat = new NFMsg.PropertyFloat();
        xPropertyFloat.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xPropertyFloat.data          = (float)newVar.FloatVal();
        xData.property_list.Add(xPropertyFloat);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectPropertyFloat>(stream, xData);
        Debug.Log("send upload Float");
        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_FLOAT, stream);
    }
Ejemplo n.º 6
0
        public void RequirePropertyFloat(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyFloat xData = new NFMsg.ObjectPropertyFloat();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyFloat xPropertyFloat = new NFMsg.PropertyFloat();
            xPropertyFloat.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyFloat.data          = (float)newVar.FloatVal();
            xData.property_list.Add(xPropertyFloat);

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

            Debug.Log("send upload Float");
            NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_FLOAT, mxBody);
        }
Ejemplo n.º 7
0
        private void OnPropertyFloat(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyFloat propertyData = NFMsg.ObjectPropertyFloat.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.AddFloat(0.0f);

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

                property.SetFloat(propertyData.property_list[i].data);
            }
        }
Ejemplo n.º 8
0
		private void EGMI_ACK_PROPERTY_FLOAT(MsgHead head, MemoryStream stream)
		{
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream);

			NFMsg.ObjectPropertyFloat propertyData = new NFMsg.ObjectPropertyFloat();
            propertyData = Serializer.Deserialize<NFMsg.ObjectPropertyFloat>(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.AddFloat(0.0f);

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

                property.SetFloat(propertyData.property_list[i].data);
			}
		}
Ejemplo n.º 9
0
    public void RequirePropertyFloat(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyFloat xData = new NFMsg.ObjectPropertyFloat();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyFloat xPropertyFloat = new NFMsg.PropertyFloat();
        xPropertyFloat.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xPropertyFloat.data = (float)newVar.FloatVal();
        xData.property_list.Add(xPropertyFloat);

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