Beispiel #1
0
        private void EGMI_ACK_SWAP_ROW(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordSwap xData = new NFMsg.ObjectRecordSwap();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordSwap)) as NFMsg.ObjectRecordSwap;

            NFIObject        go            = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xData.player_id));
            NFIRecordManager recordManager = go.GetRecordManager();
            NFIRecord        record        = recordManager.GetRecord(System.Text.Encoding.Default.GetString(xData.origin_record_name));

            record.SwapRow(xData.row_origin, xData.row_target);
        }
Beispiel #2
0
        private void EGMI_ACK_ENTER_GAME(NFMsg.MsgBase xMsg)
        {
            mxNetController.mPlayerState = NFNetController.PLAYER_STATE.E_PLAYER_GAMEING;
            NFCSectionManager.Instance.SetGameState(NFCSection.UI_SECTION_STATE.UISS_GAMEING);

            NFMsg.AckEventResult xData = new NFMsg.AckEventResult();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.AckEventResult)) as NFMsg.AckEventResult;

            NFNetController.Instance.xMainRoleID = NFNetController.PBToNF(xData.event_object);
            NFRender.Instance.LoadScene((int)xData.event_code);
        }
Beispiel #3
0
        private void EGMI_ACK_SKILL_OBJECTX(NFMsg.MsgBase xMsg)
        {
            NFMsg.ReqAckUseSkill xData = new NFMsg.ReqAckUseSkill();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ReqAckUseSkill)) as NFMsg.ReqAckUseSkill;

            NFGUID     xUser       = NFNetController.PBToNF(xData.user);
            GameObject xGameObject = NFRender.Instance.GetObject(xUser);

            if (xGameObject)
            {
            }
        }
Beispiel #4
0
        //set fight hero
        public void RequireSetFightHero(NFrame.NFGUID objectID, NFrame.NFGUID hero, int nSet)
        {
            NFMsg.ReqSetFightHero xData = new NFMsg.ReqSetFightHero();

            xData.Heroid = NFNetController.NFToPB(hero);
            xData.Set    = nSet;

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

            SendMsg(objectID, NFMsg.EGameMsgID.EGEC_REQ_SET_FIGHT_HERO, mxBody);
        }
Beispiel #5
0
        public void RequireChat(NFrame.NFGUID objectID, NFrame.NFGUID targetID, int nType, string strData)
        {
            NFMsg.ReqAckPlayerChat xData = new NFMsg.ReqAckPlayerChat();
            xData.chat_id   = NFNetController.NFToPB(targetID);
            xData.chat_name = UnicodeEncoding.Default.GetBytes(mxNetController.strRoleName);
            xData.chat_type = (NFMsg.ReqAckPlayerChat.EGameChatType)nType;
            xData.chat_info = UnicodeEncoding.Default.GetBytes(strData);

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

            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_CHAT, mxBody);
        }
Beispiel #6
0
        private void EGMI_ACK_ADD_ROW(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordAddRow)) as NFMsg.ObjectRecordAddRow;

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

            for (int i = 0; i < xData.row_data.Count; i++)
            {
                ADD_ROW(NFNetController.PBToNF(xData.player_id), System.Text.Encoding.Default.GetString(xData.record_name), xData.row_data[i]);
            }
        }
Beispiel #7
0
        public void RequireRemoveRow(NFrame.NFGUID self, string strRecordName, int nRow)
        {
            NFMsg.ObjectRecordRemove xData = new NFMsg.ObjectRecordRemove();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
            xData.remove_row.Add(nRow);

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

            Debug.Log("send upload record removeRow");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_REMOVE_ROW, mxBody);
        }
Beispiel #8
0
        public void RequireEnterGameServer(NFrame.NFGUID objectID, string strAccount, string strRoleName, int nServerID)
        {
            NFMsg.ReqEnterGameServer xData = new NFMsg.ReqEnterGameServer();
            xData.name    = UnicodeEncoding.Default.GetBytes(strRoleName);
            xData.account = UnicodeEncoding.Default.GetBytes(strAccount);
            xData.game_id = nServerID;
            xData.id      = NFNetController.NFToPB(objectID);

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

            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_ENTER_GAME, mxBody);
        }
Beispiel #9
0
        //////////////////////////////////
        ///
        private void EGMI_ACK_MOVE(NFMsg.MsgBase xMsg)
        {
            NFMsg.ReqAckPlayerMove xData = new NFMsg.ReqAckPlayerMove();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ReqAckPlayerMove)) as NFMsg.ReqAckPlayerMove;

            if (xData.target_pos.Count <= 0)
            {
                return;
            }

            float fSpeed = NFCKernelModule.Instance.QueryPropertyInt(NFNetController.PBToNF(xData.mover), "MOVE_SPEED") / 10000.0f;
            //NFRender.Instance.MoveTo(PBToNF(xData.mover), new Vector3(xData.target_pos[0].x, xData.target_pos[0].y, xData.target_pos[0].z), fSpeed, true);
        }
Beispiel #10
0
        private void EGMI_ACK_REMOVE_ROW(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordRemove xData = new NFMsg.ObjectRecordRemove();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordRemove)) as NFMsg.ObjectRecordRemove;

            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.remove_row.Count; i++)
            {
                record.Remove(xData.remove_row[i]);
            }
        }
Beispiel #11
0
        private void EGMI_ACK_RECORD_OBJECT(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectRecordObject)) as NFMsg.ObjectRecordObject;

            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.SetObject(xData.property_list[i].row, xData.property_list[i].col, NFNetController.PBToNF(xData.property_list[i].data));
            }
        }
Beispiel #12
0
        public void RequireUseItem(NFrame.NFGUID objectID, string strItemID, NFrame.NFGUID nTargetID)
        {
            NFMsg.ReqAckUseItem xData = new NFMsg.ReqAckUseItem();
            xData.user            = NFNetController.NFToPB(objectID);
            xData.item_guid       = new NFMsg.Ident();
            xData.item            = new ItemStruct();
            xData.item.item_id    = strItemID;
            xData.item.item_count = 1;
            xData.targetid        = (NFNetController.NFToPB(nTargetID));

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

            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_ITEM_OBJECT, mxBody);
        }
Beispiel #13
0
        public void RequireSwapRow(NFrame.NFGUID self, string strRecordName, int nOriginRow, int nTargetRow)
        {
            NFMsg.ObjectRecordSwap xData = new NFMsg.ObjectRecordSwap();
            xData.player_id          = NFNetController.NFToPB(self);
            xData.origin_record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
            xData.target_record_name = System.Text.Encoding.Default.GetBytes(strRecordName);
            xData.row_origin         = nOriginRow;
            xData.row_target         = nTargetRow;

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

            Debug.Log("send upload record swapRow");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_SWAP_ROW, mxBody);
        }
Beispiel #14
0
        public void RequireMoveImmune(NFrame.NFGUID objectID, float fX, float fZ)
        {
            NFMsg.ReqAckPlayerMove xData = new NFMsg.ReqAckPlayerMove();
            xData.mover    = NFNetController.NFToPB(objectID);
            xData.moveType = 0;
            NFMsg.Vector3 xTargetPos = new NFMsg.Vector3();
            xTargetPos.x = fX;
            xTargetPos.z = fZ;
            xData.target_pos.Add(xTargetPos);

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


            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_MOVE_IMMUNE, mxBody);
        }
Beispiel #15
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);
        }
Beispiel #16
0
        public void RequireUseItem(NFrame.NFGUID objectID, string strItemID, NFrame.NFGUID nTargetID, UnityEngine.Vector3 pos)
        {
            NFMsg.ReqAckUseItem xData = new NFMsg.ReqAckUseItem();
            xData.user            = NFNetController.NFToPB(objectID);
            xData.item_guid       = new NFMsg.Ident();
            xData.item            = new ItemStruct();
            xData.item.item_id    = UnicodeEncoding.Default.GetBytes(strItemID);
            xData.item.item_count = 1;
            xData.targetid        = (NFNetController.NFToPB(nTargetID));
            xData.position        = (NFNetController.NFToPB(new NFVector3(pos.x, pos.y, pos.z)));

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

            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_ITEM_OBJECT, mxBody);
        }
Beispiel #17
0
        ////////////////////////////////////修改自身属性
        public void RequirePropertyInt(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyInt xData = new NFMsg.ObjectPropertyInt();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyInt xPropertyInt = new NFMsg.PropertyInt();
            xPropertyInt.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyInt.data          = newVar.IntVal();
            xData.property_list.Add(xPropertyInt);

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

            Debug.Log("send upload int");
            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_INT, mxBody);
        }
Beispiel #18
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);
        }
Beispiel #19
0
        public void RequireRecordVector3(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordVector3 xData = new NFMsg.ObjectRecordVector3();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3();
            xRecordVector.row  = nRow;
            xRecordVector.col  = nCol;
            xRecordVector.data = NFNetController.NFToPB(newVar.Vector3Val());

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

            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_VECTOR3, mxBody);
        }
Beispiel #20
0
        private void EGMI_ACK_STATE_SYNC(NFMsg.MsgBase xMsg)
        {
            NFMsg.ReqAckPlayerMove xData = new NFMsg.ReqAckPlayerMove();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ReqAckPlayerMove)) as NFMsg.ReqAckPlayerMove;

            if (xData.target_pos.Count <= 0)
            {
                return;
            }

            NFGUID    xGUID   = NFNetController.PBToNF(xData.mover);
            NFIObject xObject = NFCKernelModule.Instance.GetObject(xGUID);

            if (xObject != null)
            {
            }
        }
Beispiel #21
0
        public void RequireRecordObject(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordObject xData = new NFMsg.ObjectRecordObject();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
            xData.property_list.Add(xRecordObject);
            xRecordObject.row  = nRow;
            xRecordObject.col  = nCol;
            xRecordObject.data = NFNetController.NFToPB(newVar.ObjectVal());

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

            Debug.Log("send upload record object");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_OBJECT, mxBody);
        }
Beispiel #22
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;
                }
            }
        }
Beispiel #23
0
        private void EGMI_ACK_PROPERTY_OBJECT(NFMsg.MsgBase xMsg)
        {
            NFMsg.ObjectPropertyObject xData = new NFMsg.ObjectPropertyObject();
            xData = mxSerializer.Deserialize(new MemoryStream(xMsg.msg_data), null, typeof(NFMsg.ObjectPropertyObject)) as NFMsg.ObjectPropertyObject;

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

            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.AddObject(new NFGUID());

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

                property.SetObject(NFNetController.PBToNF(xData.property_list[i].data));
            }
        }
Beispiel #24
0
        //有可能是他副本的NPC移动,因此增加64对象ID
        public void RequireUseSkill(NFrame.NFGUID objectID, string strKillID, Int32 index, List <NFrame.NFGUID> nTargetID)
        {
            NFMsg.ReqAckUseSkill xData = new NFMsg.ReqAckUseSkill();
            xData.user      = NFNetController.NFToPB(objectID);
            xData.skill_id  = System.Text.Encoding.Default.GetBytes(strKillID);
            xData.use_index = index;

            foreach (NFGUID id in nTargetID)
            {
                NFMsg.EffectData xEffData = new NFMsg.EffectData();
                xEffData.effect_ident = (NFNetController.NFToPB(id));
                xEffData.effect_value = 0;
                xEffData.effect_rlt   = 0;

                xData.effect_data.Add(xEffData);
            }

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


            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_REQ_SKILL_OBJECTX, mxBody);
        }
Beispiel #25
0
        public void RequireAddRow(NFrame.NFGUID self, string strRecordName, int nRow)
        {
            NFMsg.ObjectRecordAddRow xData = new NFMsg.ObjectRecordAddRow();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordAddRowStruct xRecordAddRowStruct = new NFMsg.RecordAddRowStruct();
            xData.row_data.Add(xRecordAddRowStruct);
            xRecordAddRowStruct.row = nRow;

            NFIObject  xObject  = NFCKernelModule.Instance.GetObject(self);
            NFIRecord  xRecord  = xObject.GetRecordManager().GetRecord(strRecordName);
            NFDataList xRowData = xRecord.QueryRow(nRow);

            for (int i = 0; i < xRowData.Count(); i++)
            {
                switch (xRowData.GetType(i))
                {
                case NFDataList.VARIANT_TYPE.VTYPE_INT:
                {
                    NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
                    xRecordInt.row  = nRow;
                    xRecordInt.col  = i;
                    xRecordInt.data = xRowData.IntVal(i);
                    xRecordAddRowStruct.record_int_list.Add(xRecordInt);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                {
                    NFMsg.RecordFloat xRecordFloat = new NFMsg.RecordFloat();
                    xRecordFloat.row  = nRow;
                    xRecordFloat.col  = i;
                    xRecordFloat.data = (float)xRowData.FloatVal(i);
                    xRecordAddRowStruct.record_float_list.Add(xRecordFloat);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                {
                    NFMsg.RecordString xRecordString = new NFMsg.RecordString();
                    xRecordString.row  = nRow;
                    xRecordString.col  = i;
                    xRecordString.data = System.Text.Encoding.Default.GetBytes(xRowData.StringVal(i));
                    xRecordAddRowStruct.record_string_list.Add(xRecordString);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                {
                    NFMsg.RecordObject xRecordObject = new NFMsg.RecordObject();
                    xRecordObject.row  = nRow;
                    xRecordObject.col  = i;
                    xRecordObject.data = NFNetController.NFToPB(xRowData.ObjectVal(i));
                    xRecordAddRowStruct.record_object_list.Add(xRecordObject);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                {
                    NFMsg.RecordVector2 xRecordVector = new NFMsg.RecordVector2();
                    xRecordVector.row  = nRow;
                    xRecordVector.col  = i;
                    xRecordVector.data = NFNetController.NFToPB(xRowData.Vector2Val(i));
                    xRecordAddRowStruct.record_vector2_list.Add(xRecordVector);
                }
                break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                {
                    NFMsg.RecordVector3 xRecordVector = new NFMsg.RecordVector3();
                    xRecordVector.row  = nRow;
                    xRecordVector.col  = i;
                    xRecordVector.data = NFNetController.NFToPB(xRowData.Vector3Val(i));
                    xRecordAddRowStruct.record_vector3_list.Add(xRecordVector);
                }
                break;
                }
            }

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

            Debug.Log("send upload record addRow");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_ADD_ROW, mxBody);
        }
Beispiel #26
0
        private void AttachObjectData(NFGUID self)
        {
            ObjectDataBuff xDataBuff;

            if (mxObjectDataBuff.TryGetValue(self, out xDataBuff))
            {
                ////////////////record
                for (int j = 0; j < xDataBuff.xRecordList.record_list.Count; j++)
                {
                    NFMsg.ObjectRecordBase xObjectRecordBase = xDataBuff.xRecordList.record_list[j];
                    string srRecordName = System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name);

                    for (int k = 0; k < xObjectRecordBase.row_struct.Count; ++k)
                    {
                        NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[k];

                        ADD_ROW(self, System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name), xAddRowStruct);
                    }
                }
                ////////////////property
                NFIObject          go = NFCKernelModule.Instance.GetObject(NFNetController.PBToNF(xDataBuff.xPropertyList.player_id));
                NFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xDataBuff.xPropertyList.property_int_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.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(xDataBuff.xPropertyList.property_int_list[j].data);
                }

                for (int j = 0; j < xDataBuff.xPropertyList.property_float_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.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(xDataBuff.xPropertyList.property_float_list[j].data);
                }

                for (int j = 0; j < xDataBuff.xPropertyList.property_string_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.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(xDataBuff.xPropertyList.property_string_list[j].data));
                }

                for (int j = 0; j < xDataBuff.xPropertyList.property_object_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xDataBuff.xPropertyList.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(xDataBuff.xPropertyList.property_object_list[j].data));
                }
            }
        }
Beispiel #27
0
        private void ADD_ROW(NFGUID self, string strRecordName, NFMsg.RecordAddRowStruct xAddStruct)
        {
            NFIObject        go             = NFCKernelModule.Instance.GetObject(self);
            NFIRecordManager xRecordManager = go.GetRecordManager();

            Hashtable recordVecDesc = new Hashtable();
            Hashtable recordVecData = new Hashtable();

            for (int k = 0; k < xAddStruct.record_int_list.Count; ++k)
            {
                NFMsg.RecordInt addIntStruct = (NFMsg.RecordInt)xAddStruct.record_int_list[k];

                if (addIntStruct.col >= 0)
                {
                    recordVecDesc[addIntStruct.col] = NFDataList.VARIANT_TYPE.VTYPE_INT;
                    recordVecData[addIntStruct.col] = addIntStruct.data;
                }
            }

            for (int k = 0; k < xAddStruct.record_float_list.Count; ++k)
            {
                NFMsg.RecordFloat addFloatStruct = (NFMsg.RecordFloat)xAddStruct.record_float_list[k];

                if (addFloatStruct.col >= 0)
                {
                    recordVecDesc[addFloatStruct.col] = NFDataList.VARIANT_TYPE.VTYPE_FLOAT;
                    recordVecData[addFloatStruct.col] = addFloatStruct.data;
                }
            }

            for (int k = 0; k < xAddStruct.record_string_list.Count; ++k)
            {
                NFMsg.RecordString addStringStruct = (NFMsg.RecordString)xAddStruct.record_string_list[k];

                if (addStringStruct.col >= 0)
                {
                    recordVecDesc[addStringStruct.col] = NFDataList.VARIANT_TYPE.VTYPE_STRING;
                    recordVecData[addStringStruct.col] = System.Text.Encoding.Default.GetString(addStringStruct.data);
                }
            }

            for (int k = 0; k < xAddStruct.record_object_list.Count; ++k)
            {
                NFMsg.RecordObject addObjectStruct = (NFMsg.RecordObject)xAddStruct.record_object_list[k];

                if (addObjectStruct.col >= 0)
                {
                    recordVecDesc[addObjectStruct.col] = NFDataList.VARIANT_TYPE.VTYPE_OBJECT;
                    recordVecData[addObjectStruct.col] = NFNetController.PBToNF(addObjectStruct.data);
                }
            }

            NFDataList varListDesc = new NFDataList();
            NFDataList varListData = new NFDataList();

            for (int m = 0; m < recordVecDesc.Count; m++)
            {
                if (recordVecDesc.ContainsKey(m) && recordVecData.ContainsKey(m))
                {
                    NFDataList.VARIANT_TYPE nType = (NFDataList.VARIANT_TYPE)recordVecDesc[m];
                    switch (nType)
                    {
                    case NFDataList.VARIANT_TYPE.VTYPE_INT:
                    {
                        varListDesc.AddInt(0);
                        varListData.AddInt((Int64)recordVecData[m]);
                    }

                    break;

                    case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                    {
                        varListDesc.AddFloat(0.0f);
                        varListData.AddFloat((float)recordVecData[m]);
                    }
                    break;

                    case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                    {
                        varListDesc.AddString("");
                        varListData.AddString((string)recordVecData[m]);
                    }
                    break;

                    case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                    {
                        varListDesc.AddObject(new NFGUID());
                        varListData.AddObject((NFGUID)recordVecData[m]);
                    }
                    break;

                    default:
                        break;
                    }
                }
                else
                {
                    //����
                    //Debug.LogException(i);
                }
            }

            NFIRecord xRecord = xRecordManager.GetRecord(strRecordName);

            if (null == xRecord)
            {
                xRecord = xRecordManager.AddRecord(strRecordName, 512, varListDesc);
            }

            xRecord.AddRow(xAddStruct.row, varListData);
        }
Beispiel #28
0
 public NFNetClient(NFNetController clientNet)
 {
     mxNetController = clientNet;
     Init();
 }
Beispiel #29
0
 public NFMsgEventResult(NFNetController net)
 {
     mxNetController = net;
     mxNetController.mxNetClient.GetNetListener().RegisteredResultCodeDelegation(NFMsg.EGameEventCode.EGEC_UNKOWN_ERROR, EGEC_UNKOWN_ERROR);
     mxNetController.mxNetClient.GetNetListener().RegisteredResultCodeDelegation(NFMsg.EGameEventCode.EGEC_ACCOUNT_SUCCESS, EGEC_ACCOUNT_SUCCESS);
 }
Beispiel #30
0
 public NFNetSender(NFNetController clientnet)
 {
     mxNetController = clientnet;
 }