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

            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.AddVector3(new NFVector3());

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

                property.SetVector3(NFNetController.PBToNF(xData.property_list[i].data));
            }
        }
        private void EGMI_ACK_PROPERTY_VECTOR3(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyVector3 xData = NFMsg.ObjectPropertyVector3.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();
                NFMsg.Vector3 data = xData.PropertyList[i].Data;

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

                property.SetVector3(mHelpModule.PBToNF(data));
            }
        }
Example #3
0
        private void OnPropertyVector3(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.ObjectPropertyVector3 propertyData = new NFMsg.ObjectPropertyVector3();
            propertyData = Serializer.Deserialize <NFMsg.ObjectPropertyVector3>(new MemoryStream(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(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name));
                if (null == property)
                {
                    NFDataList varList = new NFDataList();
                    varList.AddVector3(new NFVector3());

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

                property.SetVector3(mHelpModule.PBToNF(propertyData.property_list[i].data));
            }
        }
Example #4
0
        public void RequirePropertyVector3(NFGUID objectID, string strPropertyName, NFVector3 newVar)
        {
            NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
            xData.PlayerId = mHelpModule.NFToPB(objectID);

            NFMsg.PropertyVector3 xProperty = new NFMsg.PropertyVector3();
            xProperty.PropertyName = ByteString.CopyFromUtf8(strPropertyName);
            xProperty.Data         = mHelpModule.NFToPB(newVar);
            xData.PropertyList.Add(xProperty);

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


            SendMsg((int)NFMsg.EGameMsgID.AckPropertyVector3, mxBody);
        }
    public void RequirePropertyVector3(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyVector3 xProperty = new NFMsg.PropertyVector3();
        xProperty.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xProperty.data          = NFBinarySendLogic.NFToPB(newVar.Vector3Val());
        xData.property_list.Add(xProperty);

        MemoryStream stream = new MemoryStream();

        Serializer.Serialize <NFMsg.ObjectPropertyVector3>(stream, xData);

        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR3, stream);
    }
Example #6
0
        public void RequirePropertyVector3(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyVector3 xProperty = new NFMsg.PropertyVector3();
            xProperty.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xProperty.data          = NFNetController.NFToPB(newVar.Vector3Val());
            xData.property_list.Add(xProperty);

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


            NFNetController.Instance.mxNetSender.SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR3, mxBody);
        }
        private void EGMI_ACK_PROPERTY_CLEAR(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyVector3 xData = NFMsg.ObjectPropertyVector3.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();
            //propertyManager.
        }
        private void OnPropertyVector3(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.ObjectPropertyVector3 propertyData = NFMsg.ObjectPropertyVector3.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.AddVector3(new NFVector3());

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

                property.SetVector3(mHelpModule.PBToNF(propertyData.property_list[i].data));
            }
        }
Example #9
0
    public void RequirePropertyVector3(NFrame.NFGUID objectID, string strPropertyName, NFIDataList.TData newVar)
    {
        NFMsg.ObjectPropertyVector3 xData = new NFMsg.ObjectPropertyVector3();
        xData.player_id = NFBinarySendLogic.NFToPB(objectID);

        NFMsg.PropertyVector3 xProperty = new NFMsg.PropertyVector3();
        xProperty.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
        xProperty.data = NFBinarySendLogic.NFToPB(newVar.Vector3Val());
        xData.property_list.Add(xProperty);

        MemoryStream stream = new MemoryStream();
        Serializer.Serialize<NFMsg.ObjectPropertyVector3>(stream, xData);

        NFStart.Instance.GetFocusSender().SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_VECTOR3, stream);
    }