public bool Parse(string strData, out AFIDENTID id) { AFIDENTID xId = new AFIDENTID(); id = xId; string[] strList = strData.Split('-'); if (strList.Count() != 2) { return(false); } Int64 nHead = 0; if (!Int64.TryParse(strList[0], out nHead)) { return(false); } Int64 nData = 0; if (!Int64.TryParse(strList[1], out nData)) { return(false); } id.nHead64 = nHead; id.nData64 = nData; return(true); }
public AFCRecord(AFIDENTID self, string strRecordName, int nRow, AFIDataList varData) { mSelf = self; mnRow = nRow; mstrRecordName = strRecordName; mVarRecordType = new AFCDataList(varData); }
public override bool SetObject(int nRow, int nCol, AFIDENTID value) { if (nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { AddRow(nRow); } AFIDataList valueList = (AFIDataList)mhtRecordVec[nRow]; if (valueList.GetType(nCol) == AFIDataList.VARIANT_TYPE.VTYPE_OBJECT) { if (valueList.ObjectVal(nCol) != value) { AFCDataList oldValue = new AFCDataList(); oldValue.AddObject(valueList.ObjectVal(nCol)); valueList.SetObject(nCol, value); AFCDataList newValue = new AFCDataList(); newValue.AddObject(valueList.ObjectVal(nCol)); if (null != doHandleDel) { doHandleDel(mSelf, mstrRecordName, eRecordOptype.Updata, nRow, nCol, oldValue, newValue); } } } return(true); } return(false); }
private void ADD_ROW(AFCoreEx.AFIDENTID self, string strRecordName, AFMsg.DataTableAddRow xAddStruct) { AFIObject go = AFCKernel.Instance.GetObject(self); AFIRecordManager xRecordManager = go.GetRecordManager(); Hashtable recordVecDesc = new Hashtable(); Hashtable recordVecData = new Hashtable(); AFCoreEx.AFCDataList RowList = new AFCDataList(); AFCoreEx.AFIDataList varListDesc = new AFCDataList(); for (int k = 0; k < xAddStruct.CellList.Count; ++k) { AFMsg.PBCellData addStruct = (AFMsg.PBCellData)xAddStruct.CellList[k]; if (addStruct.Col >= 0) { int nRow = -1; int nCol = -1; AFCoreEx.AFIDataList.Var_Data xRowData = PBRecordToData(addStruct, ref nRow, ref nCol); RowList.AddDataObject(ref xRowData); varListDesc.AddDataObject(ref xRowData); } } AFIRecord xRecord = xRecordManager.GetRecord(strRecordName); if (null == xRecord) { xRecord = xRecordManager.AddRecord(strRecordName, 512, varListDesc); } xRecord.AddRow(xAddStruct.Row, RowList); }
public void RequirePickUpItem(AFCoreEx.AFIDENTID objectID, AFCoreEx.AFIDENTID nItemID) { AFMsg.ReqPickDropItem xData = new AFMsg.ReqPickDropItem(); xData.ItemGuid = AFToPB(nItemID); SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqPickItem, xData); }
//有可能是他副本的NPC移动,因此增加64对象ID public void RequireUseSkill(AFCoreEx.AFIDENTID objectID, string strKillID, AFCoreEx.AFIDENTID nTargetID, float fNowX, float fNowZ, float fTarX, float fTarZ) { //Debug.Log("RequireUseSkill:" + strKillID); AFMsg.Position xNowPos = new AFMsg.Position(); AFMsg.Position xTarPos = new AFMsg.Position(); xNowPos.X = fNowX; xNowPos.Y = 0.0f; xNowPos.Z = fNowZ; xTarPos.X = fTarX; xTarPos.Y = 0.0f; xTarPos.Z = fTarZ; AFMsg.ReqAckUseSkill xData = new AFMsg.ReqAckUseSkill(); xData.User = AFToPB(objectID); xData.SkillId = strKillID; xData.TarPos = xTarPos; xData.NowPos = xNowPos; if (!nTargetID.IsNull()) { AFMsg.EffectData xEffectData = new AFMsg.EffectData(); xEffectData.EffectIdent = AFToPB(nTargetID); xEffectData.EffectValue = 0; xEffectData.EffectRlt = 0; xData.EffectData.Add(xEffectData); } SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqSkillObjectx, xData); }
public void SendMsg(AFCoreEx.AFIDENTID xID, AFMsg.EGameMsgID unMsgID, IMessage xData) { MemoryStream stream = new MemoryStream(); MessageExtensions.WriteTo(xData, stream); SendMsg(xID, unMsgID, stream); }
static public AFCoreEx.AFIDENTID PBToAF(AFMsg.PBGUID xID) { AFCoreEx.AFIDENTID xIdent = new AFCoreEx.AFIDENTID(); xIdent.nHead64 = xID.High; xIdent.nData64 = xID.Low; return(xIdent); }
static public AFMsg.PBGUID AFToPB(AFCoreEx.AFIDENTID xID) { AFMsg.PBGUID xIdent = new AFMsg.PBGUID(); xIdent.High = xID.nHead64; xIdent.Low = xID.nData64; return(xIdent); }
public AFCHeartBeat(AFIDENTID self, string strHeartBeatName, float fTime, AFIDataList valueList) { mSelf = self; mstrHeartBeatName = strHeartBeatName; mfTime = fTime; mfOldTime = fTime; mArgValueList = valueList; }
public override void RegisterRecordCallback(AFIDENTID self, string strRecordName, AFIRecord.RecordEventHandler handler) { AFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetRecordManager().RegisterCallback(strRecordName, handler); } }
public override void RegisterPropertyCallback(AFIDENTID self, string strPropertyName, AFIProperty.PropertyEventHandler handler) { AFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetPropertyManager().RegisterCallback(strPropertyName, handler); } }
///////////////////////////////////////////////////////////// //public override bool AddRecordCallBack( AFIDENTID self, string strRecordName, RECORD_EVENT_FUNC cb ); //public override bool AddPropertyCallBack( AFIDENTID self, string strCriticalName, PROPERTY_EVENT_FUNC cb ); // public override bool AddClassCallBack( string strClassName, CLASS_EVENT_FUNC cb ); // // public override bool RemoveClassCallBack( string strClassName, CLASS_EVENT_FUNC cb ); ///////////////////////////////////////////////////////////////// public override AFIObject GetObject(AFIDENTID ident) { if (null != ident && mhtObject.ContainsKey(ident)) { return((AFIObject)mhtObject[ident]); } return(null); }
public override void RegisterEventCallBack(AFIDENTID self, int nEventID, AFIEvent.EventHandler handler, AFIDataList valueList) { AFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetEventManager().RegisterCallback(nEventID, handler, valueList); } }
public AFCObject(AFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex) { mSelf = self; mstrClassName = strClassName; mstrConfigIndex = strConfigIndex; mnContainerID = nContainerID; mnGroupID = nGroupID; Init(); }
public void RequireDelRole(AFCoreEx.AFIDENTID objectID, string strAccount, string strRoleName, int nGameID) { AFMsg.ReqDeleteRole xData = new AFMsg.ReqDeleteRole(); xData.Name = strRoleName; xData.Account = strAccount; xData.GameId = nGameID; SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqDeleteRole, xData); }
static void HeartBeatEventHandler(AFIDENTID self, string strHeartBeat, float fTime, AFIDataList valueList) { Console.Write(self); Console.Write(" "); Console.Write(strHeartBeat); Console.Write(" "); Console.Write(fTime.ToString()); Console.WriteLine(" "); }
private void SendMsg(AFCoreEx.AFIDENTID xID, AFMsg.EGameMsgID unMsgID, MemoryStream stream) { MsgHead head = new MsgHead(); head.unMsgID = (UInt16)unMsgID; head.nHead64 = xID.nHead64; head.nData64 = xID.nData64; mxPlayerNet.mxNet.SendMsg(head, stream.ToArray()); }
public void RequireSwapScene(AFCoreEx.AFIDENTID objectID, int nTransferType, int nSceneID, int nLineIndex) { AFMsg.ReqAckSwapScene xData = new AFMsg.ReqAckSwapScene(); xData.TransferType = (AFMsg.ReqAckSwapScene.Types.EGameSwapType)nTransferType; xData.SceneId = nSceneID; xData.LineId = nLineIndex; SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqSwapScene, xData); }
public void RequireChat(AFCoreEx.AFIDENTID objectID, AFCoreEx.AFIDENTID targetID, int nType, string strData) { AFMsg.ReqAckPlayerChat xData = new AFMsg.ReqAckPlayerChat(); xData.ChatId = AFToPB(targetID); xData.ChatType = (AFMsg.ReqAckPlayerChat.Types.EGameChatType)nType; xData.ChatInfo = strData; SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqChat, xData); }
public void RequireEnterGameServer(AFCoreEx.AFIDENTID objectID, string strAccount, string strRoleName, int nServerID) { AFMsg.ReqEnterGameServer xData = new AFMsg.ReqEnterGameServer(); xData.Name = strRoleName; xData.Account = strAccount; xData.GameId = nServerID; xData.Id = AFToPB(objectID); SendMsg(objectID, AFMsg.EGameMsgID.EgmiReqEnterGame, xData); }
public override bool AddObject(AFIDENTID value) { Var_Data data = new Var_Data(); data.nType = VARIANT_TYPE.VTYPE_OBJECT; data.mData = value; return(AddDataObject(ref data)); }
static void HeartBeatEventHandler(AFIDENTID self, string strHeartBeat, float fTime, AFIDataList valueList) { Debug.Log(self); Debug.Log(" "); Debug.Log(strHeartBeat); Debug.Log(" "); Debug.Log(fTime.ToString()); Debug.Log(" "); }
public override string QueryPropertyString(AFIDENTID self, string strPropertyName) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.QueryPropertyString(strPropertyName)); } return(""); }
public override AFIDENTID QueryPropertyObject(AFIDENTID self, string strPropertyName) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.QueryPropertyObject(strPropertyName)); } return(new AFIDENTID()); }
public override AFIRecord FindRecord(AFIDENTID self, string strRecordName) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.GetRecordManager().GetRecord(strRecordName)); } return(null); }
public override bool SetRecordObject(AFIDENTID self, string strRecordName, int nRow, int nCol, AFIDENTID objectValue) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.SetRecordObject(strRecordName, nRow, nCol, objectValue)); } return(false); }
public override bool AddHeartBeat(AFIDENTID self, string strHeartBeatName, AFIHeartBeat.HeartBeatEventHandler handler, float fTime, AFIDataList valueList) { AFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetHeartBeatManager().AddHeartBeat(strHeartBeatName, fTime, handler, valueList); } return(true); }
public override double QueryRecordDouble(AFIDENTID self, string strRecordName, int nRow, int nCol) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.QueryRecordDouble(strRecordName, nRow, nCol)); } return(0.0); }
public override AFIDENTID QueryRecordObject(AFIDENTID self, string strRecordName, int nRow, int nCol) { if (mhtObject.ContainsKey(self)) { AFIObject xGameObject = (AFIObject)mhtObject[self]; return(xGameObject.QueryRecordObject(strRecordName, nRow, nCol)); } return(new AFIDENTID()); }