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 = NFCKernel.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); } }
//////////////////////////////////////////////////////////// void OnOpratorGUI(int nHeight, int nWidth) { ////////////////////////////////// if (null != mxClient && mxClient.IsConnected() && mPlayerState == PLAYER_STATE.E_PLAYER_GAMEING) { ////聊天 scrollVecChatMsg = GUI.BeginScrollView(new Rect(350, nHeight / 2 + 20, 240, nHeight / 2 - 50), scrollVecChatMsg, new Rect(0, 0, 1500, 3000)); int nChatIndex = 0; for (int i = mxListener.aChatMsgList.Count - 1; i >= 0; i--) { string strData = (string)mxListener.aChatMsgList[i]; GUI.Label(new Rect(0, nChatIndex * 20, 2000, 20), strData); nChatIndex++; } GUI.EndScrollView(); ////网络消息 scrollVecMsg = GUI.BeginScrollView(new Rect(560 + 40, nHeight / 2 + 20, 240, nHeight / 2 - 50), scrollVecMsg, new Rect(0, 0, 1500, 3000)); int nNetIndex = 0; for (int i = mxListener.aMsgList.Count - 1; i >= 0; i--) { string strData = (string)mxListener.aMsgList[i]; GUI.Label(new Rect(0, nNetIndex * 20, 2000, 20), strData); nNetIndex++; } GUI.EndScrollView(); //操作功能区 scrollVecBtn = GUI.BeginScrollView(new Rect(850, 535, 410, nHeight / 2 - 50), scrollVecBtn, new Rect(0, 0, 500, 1200)); //////////////////////////////////////////////////////////////////////////////////////////////// if (GUI.Button(new Rect(0, 0, 100, 50), "SwapScene")) { mxSendLogic.RequireSwapScene(nMainRoleID, 0, int.Parse(strReqSwapSceneID), -1); } strReqSwapSceneID = GUI.TextField(new Rect(100, 0, 100, 50), strReqSwapSceneID); strReqSwapGroupID = GUI.TextField(new Rect(200, 0, 100, 50), strReqSwapGroupID); //////////////////////////////////////////////////////////////////////////////////////////////// if (GUI.Button(new Rect(0, 50, 100, 50), "Move")) { mxSendLogic.RequireMove(nMainRoleID, float.Parse(strReqMoveX), float.Parse(strReqMoveZ)); } strReqMoveX = GUI.TextField(new Rect(100, 50, 100, 50), strReqMoveX); strReqMoveZ = GUI.TextField(new Rect(200, 50, 100, 50), strReqMoveZ); //////////////////////////////////////////////////////////////////////////////////////////////// if (GUI.Button(new Rect(0, 100, 100, 50), "Chat")) { mxSendLogic.RequireChat(nMainRoleID, new NFrame.NFGUID(), 3, strChatData); //test if (false) { int value = int.Parse(strChatData); NFIObject obj = NFCKernelModule.Instance.GetObject(nMainRoleID); NFIPropertyManager propertyManager = obj.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty("Gold"); property.SetInt(value); } } strChatData = GUI.TextField(new Rect(100, 100, 300, 50), strChatData); //////////////////////////////////////////////////////////////////////////////////////////////// if (GUI.Button(new Rect(0, 150, 100, 50), "UseSkill")) { NFGUID xMonsterID = new NFGUID(); xMonsterID.Parse(strReqKillNPCID, out xMonsterID); mxSendLogic.RequireUseSkill(nMainRoleID, "", xMonsterID, 0f, 0f, 0f, 0f); } strReqKillID = GUI.TextField(new Rect(100, 150, 100, 50), strReqKillID); strReqKillNPCID = GUI.TextField(new Rect(200, 150, 200, 50), strReqKillNPCID); /* * * * //////////////////////////////////////////////////////////////////////////////////////////////// * * if (GUI.Button(new Rect(0, 150, 100, 50), "交任务")) * { * sendLogic.RequireCompeleteTask(nSelfID, strReqAcceptTaskID); * } * strReqAcceptTaskID = GUI.TextField(new Rect(100, 150, 100, 50), strReqAcceptTaskID); * * //////////////////////////////////////////////////////////////////////////////////////////////// * * * * //////////////////////////////////////////////////////////////////////////////////////////////// * if (GUI.Button(new Rect(0, 250, 100, 50), "使用道具")) * { * sendLogic.RequireUseItem(long.Parse(strReqUseItemID), nSelfID); * } * strReqUseItemID = GUI.TextField(new Rect(100, 250, 100, 50), strReqUseItemID); * * //////////////////////////////////////////////////////////////////////////////////////////////// * * if (GUI.Button(new Rect(0, 300, 100, 50), "拾取")) * { * sendLogic.RequirePickUpItem(long.Parse(strPickUpItemID)); * } * strPickUpItemID = GUI.TextField(new Rect(100, 300, 100, 50), strPickUpItemID); * * //////////////////////////////////////////////////////////////////////////////////////////////// * if (GUI.Button(new Rect(0, 450, 100, 50), "接任务")) * { * sendLogic.RequireAcceptTask(strReqAcceptTaskID); * } * strReqAcceptTaskID = GUI.TextField(new Rect(100, 450, 100, 50), strReqAcceptTaskID); * */ // if (GUI.Button(new Rect(0, 350, 100, 50), "Set Property")) // { // //mxSendLogic.RequireProperty(nMainRoleID, strReqSetProperty, int.Parse(strReqPropertyValue)); // } // strReqSetProperty = GUI.TextField(new Rect(100, 350, 100, 50), strReqSetProperty); // strReqPropertyValue = GUI.TextField(new Rect(200, 350, 100, 50), strReqPropertyValue); //////////////////////////////////////////////////////////////////////////////////////////////// /* * if (GUI.Button(new Rect(0, 400, 100, 50), "添加道具")) * { * sendLogic.RequireItem(strReqAddItem, int.Parse(strAddCount)); * } * strReqAddItem = GUI.TextField(new Rect(100, 400, 100, 50), strReqAddItem); * strAddCount = GUI.TextField(new Rect(200, 400, 100, 50), strAddCount); */ //////////////////////////////////////////////////////////////////////////////////////////////// GUI.EndScrollView(); } }
private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(MsgHead head, 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 = NFCKernel.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 NFIDENTID()); xProperty = xPropertyManager.AddProperty(strPropertyName, varList); } xProperty.SetObject(PBToNF(xPropertyData.property_object_list[j].data)); } } }