Inheritance: global::ProtoBuf.IExtensible
        private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(int id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

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

            for (int i = 0; i < xData.MultiPlayerProperty.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xData.MultiPlayerProperty[i];
                NFGUID xObjectID = mHelpModule.PBToNF(xPropertyData.PlayerId);

                ObjectDataBuff xDataBuff;
                if (mxObjectDataBuff.TryGetValue(xObjectID, out xDataBuff))
                {
                    xDataBuff.xPropertyList = xPropertyData;
                    if (xObjectID.IsNull())
                    {
                        AttachObjectData(xObjectID);
                    }
                }
                else
                {
                    xDataBuff = new ObjectDataBuff();
                    xDataBuff.xPropertyList     = xPropertyData;
                    mxObjectDataBuff[xObjectID] = xDataBuff;
                    AttachObjectData(xObjectID);
                }
            }
        }
示例#2
0
        private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(NFMsg.MsgBase xMsg)
        {
            NFMsg.MultiObjectPropertyList xData = new NFMsg.MultiObjectPropertyList();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.MultiObjectPropertyList)) as NFMsg.MultiObjectPropertyList;

            for (int i = 0; i < xData.multi_player_property.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xData.multi_player_property[i];
                NFGUID xObjectID = NFNetController.PBToNF(xPropertyData.player_id);

                //Debug.Log ("new property enter Object: " + xObjectID.ToString () );

                ObjectDataBuff xDataBuff;
                if (mxObjectDataBuff.TryGetValue(xObjectID, out xDataBuff))
                {
                    xDataBuff.xPropertyList = xPropertyData;
                }
            }
        }
示例#3
0
        private void OnObjectPropertyEntry(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.MultiObjectPropertyList xMultiObjectPropertyList = new NFMsg.MultiObjectPropertyList();
            xMultiObjectPropertyList = Serializer.Deserialize <NFMsg.MultiObjectPropertyList>(new MemoryStream(xMsg.msg_data));

            for (int i = 0; i < xMultiObjectPropertyList.multi_player_property.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xMultiObjectPropertyList.multi_player_property[i];
                NFIObject          go = NFCKernelModule.Instance().GetObject(PBToNF(xPropertyData.player_id));
                NFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xPropertyData.property_int_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_int_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFIDataList varList = new NFCDataList();
                        varList.AddInt(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetInt(xPropertyData.property_int_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_float_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_float_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFIDataList varList = new NFCDataList();
                        varList.AddFloat(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetFloat(xPropertyData.property_float_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_string_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFIDataList varList = new NFCDataList();
                        varList.AddString("");

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetString(System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].data));
                }

                for (int j = 0; j < xPropertyData.property_object_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_object_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFIDataList varList = new NFCDataList();
                        varList.AddObject(new NFGUID());

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetObject(PBToNF(xPropertyData.property_object_list[j].data));
                }
            }
        }
示例#4
0
        internal void OnObjectPropertyEntry(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream);

            NFMsg.MultiObjectPropertyList xMultiObjectPropertyList = NFMsg.MultiObjectPropertyList.Parser.ParseFrom(xMsg.msg_data);

            for (int i = 0; i < xMultiObjectPropertyList.multi_player_property.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xMultiObjectPropertyList.multi_player_property[i];
                NFIObject          go = mKernelModule.GetObject(mHelpModule.PBToNF(xPropertyData.player_id));
                NFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xPropertyData.property_int_list.Count; j++)
                {
                    string      strPropertyName = xPropertyData.property_int_list[j].property_name.ToStringUtf8();
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddInt(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetInt(xPropertyData.property_int_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_float_list.Count; j++)
                {
                    string      strPropertyName = xPropertyData.property_float_list[j].property_name.ToStringUtf8();
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddFloat(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetFloat(xPropertyData.property_float_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_string_list.Count; j++)
                {
                    string      strPropertyName = xPropertyData.property_string_list[j].property_name.ToStringUtf8();
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddString("");

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetString(xPropertyData.property_string_list[j].data.ToStringUtf8());
                }

                for (int j = 0; j < xPropertyData.property_object_list.Count; j++)
                {
                    string      strPropertyName = xPropertyData.property_object_list[j].property_name.ToStringUtf8();
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddObject(new NFGUID());

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetObject(mHelpModule.PBToNF(xPropertyData.property_object_list[j].data));
                }
            }
        }
示例#5
0
        private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(NFMsg.MsgBase xMsg)
        {
            NFMsg.MultiObjectPropertyList xData = new NFMsg.MultiObjectPropertyList();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.MultiObjectPropertyList)) as NFMsg.MultiObjectPropertyList;

            for (int i = 0; i < xData.multi_player_property.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xData.multi_player_property[i];
                NFGUID xObjectID = NFNetController.PBToNF(xPropertyData.player_id);

                ObjectDataBuff xDataBuff;
                if (mxObjectDataBuff.TryGetValue(xObjectID, out xDataBuff))
                {
                    xDataBuff.xPropertyList = xPropertyData;
                }

                /*
                 * NFIObject go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xPropertyData.player_id));
                 * NFIPropertyManager xPropertyManager = go.GetPropertyManager();
                 *
                 * for (int j = 0; j < xPropertyData.property_int_list.Count; j++)
                 * {
                 *      string strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_int_list[j].property_name);
                 *      NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                 *      if (null == xProperty)
                 *      {
                 *              NFDataList varList = new NFDataList();
                 *              varList.AddInt(0);
                 *
                 *              xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                 *      }
                 *
                 *      xProperty.SetInt(xPropertyData.property_int_list[j].data);
                 * }
                 *
                 * for (int j = 0; j < xPropertyData.property_float_list.Count; j++)
                 * {
                 *      string strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_float_list[j].property_name);
                 *      NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                 *      if (null == xProperty)
                 *      {
                 *              NFDataList varList = new NFDataList();
                 *              varList.AddFloat(0);
                 *
                 *              xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                 *      }
                 *
                 *      xProperty.SetFloat(xPropertyData.property_float_list[j].data);
                 * }
                 *
                 * for (int j = 0; j < xPropertyData.property_string_list.Count; j++)
                 * {
                 *      string strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].property_name);
                 *      NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                 *      if (null == xProperty)
                 *      {
                 *              NFDataList varList = new NFDataList();
                 *              varList.AddString("");
                 *
                 *              xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                 *      }
                 *
                 *      xProperty.SetString(System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].data));
                 * }
                 *
                 * for (int j = 0; j < xPropertyData.property_object_list.Count; j++)
                 * {
                 *      string strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_object_list[j].property_name);
                 *      NFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                 *      if (null == xProperty)
                 *      {
                 *              NFDataList varList = new NFDataList();
                 *              varList.AddObject(new NFGUID());
                 *
                 *              xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                 *      }
                 *
                 *      xProperty.SetObject(NFNetController.PBToNF(xPropertyData.property_object_list[j].data));
                 * }
                 */
            }
        }