internal static void World_HandleCharRename(NetState netState, PacketReader packetReader) { WorldExtendData extendData = netState.GetComponent <WorldExtendData>(WorldExtendData.COMPONENT_ID); if (extendData == null) { Debug.WriteLine("World_PacketHandlers.World_HandleCharDelete(...) - extendData == null error!"); return; } if (extendData.IsLoggedIn == false) { Debug.WriteLine("World_PacketHandlers.World_HandleCharDelete(...) - extendData.IsLoggedIn == false error!"); return; } ulong iGuid = packetReader.ReadULong64(); string strName = packetReader.ReadUTF8String(); if (ProcessServer.WowZoneCluster.World.GlobalPlayerInfo.GetPlayerInfo(strName) != null) { netState.Send(new Word_CharCreateResponseError(ResponseCodes.CHAR_CREATE_NAME_IN_USE)); return; } CharRenameSQL charEnumSQL = new CharRenameSQL(extendData, netState, (long)iGuid, strName); WaitExecuteInfo <CharRenameSQL> waitExecuteInfo = new WaitExecuteInfo <CharRenameSQL>(charEnumSQL, WorldPacketHandlers.SQL_HandleCharRename); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
internal static void World_HandleCharDelete(NetState netState, PacketReader packetReader) { LOGs.WriteLine(LogMessageType.MSG_ERROR, "World_HandleCharDelete!"); WorldExtendData extendData = netState.GetComponent <WorldExtendData>(WorldExtendData.COMPONENT_ID); if (extendData == null) { Debug.WriteLine("World_PacketHandlers.World_HandleCharDelete(...) - extendData == null error!"); return; } if (extendData.IsLoggedIn == false) { Debug.WriteLine("World_PacketHandlers.World_HandleCharDelete(...) - extendData.IsLoggedIn == false error!"); return; } ulong iGuid = packetReader.ReadULong64(); CharDeleteSQL charEnumSQL = new CharDeleteSQL(extendData, netState, (long)iGuid); WaitExecuteInfo <CharDeleteSQL> waitExecuteInfo = new WaitExecuteInfo <CharDeleteSQL>(charEnumSQL, WorldPacketHandlers.SQL_HandleCharDelete); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// <summary> /// /// </summary> /// <param name="strAccountName"></param> /// <param name="strLastIP"></param> internal static void UpdateAccountLastIP(string strAccountName, string strLastIP) { UpdateAccountLastIPSQL updateAccountLastIPSQL = new UpdateAccountLastIPSQL(strAccountName, strLastIP); WaitExecuteInfo <UpdateAccountLastIPSQL> waitExecuteInfo = new WaitExecuteInfo <UpdateAccountLastIPSQL>(updateAccountLastIPSQL, WowAccountHandler.SQL_UpdateAccountLastIP); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// <summary> ///WaitExecuteInfo`1 构造函数 的测试 ///</summary> public void WaitExecuteInfoConstructorTestHelper <T>() { T executeInfo = default(T); // TODO: 初始化为适当的值 WaitCallBack <T> waitCallBack = null; // TODO: 初始化为适当的值 WaitExecuteInfo <T> target = new WaitExecuteInfo <T>(executeInfo, waitCallBack); Assert.Inconclusive("TODO: 实现用来验证目标的代码"); }
/// <summary> ///Execute 的测试 ///</summary> public void ExecuteTestHelper <T>() { T executeInfo = default(T); // TODO: 初始化为适当的值 WaitCallBack <T> waitCallBack = null; // TODO: 初始化为适当的值 WaitExecuteInfo <T> target = new WaitExecuteInfo <T>(executeInfo, waitCallBack); // TODO: 初始化为适当的值 target.Execute(); Assert.Inconclusive("无法验证不返回值的方法。"); }
/// <summary> ///Data 的测试 ///</summary> public void DataTestHelper <T>() { T executeInfo = default(T); // TODO: 初始化为适当的值 WaitCallBack <T> waitCallBack = null; // TODO: 初始化为适当的值 WaitExecuteInfo <T> target = new WaitExecuteInfo <T>(executeInfo, waitCallBack); // TODO: 初始化为适当的值 T actual; actual = target.Data; Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// /// </summary> /// <param name="netState"></param> /// <param name="packetReader"></param> internal static void World_HandleCharEnum(NetState netState, PacketReader packetReader) { WorldExtendData extendData = netState.GetComponent <WorldExtendData>(WorldExtendData.COMPONENT_ID); if (extendData == null) { Debug.WriteLine("World_PacketHandlers.World_HandleCharEnum(...) - extendData == null error!"); return; } if (extendData.IsLoggedIn == false) { Debug.WriteLine("World_PacketHandlers.World_HandleCharEnum(...) - extendData.IsLoggedIn == false error!"); return; } CharEnumSQL charEnumSQL = new CharEnumSQL(extendData, netState); WaitExecuteInfo <CharEnumSQL> waitExecuteInfo = new WaitExecuteInfo <CharEnumSQL>(charEnumSQL, WorldPacketHandlers.SQL_HandleCharEnum); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// <summary> /// /// </summary> /// <param name="netState"></param> /// <param name="packetReader"></param> internal static void World_HandlePlayerLogin( NetState netState, PacketReader packetReader ) { WorldExtendData extendData = netState.GetComponent<WorldExtendData>( WorldExtendData.COMPONENT_ID ); if ( extendData == null ) { Debug.WriteLine( "World_PacketHandlers.World_HandleCharDelete(...) - extendData == null error!" ); return; } if ( extendData.IsLoggedIn == false ) { Debug.WriteLine( "World_PacketHandlers.World_HandleCharDelete(...) - extendData.IsLoggedIn == false error!" ); return; } ulong iGuid = packetReader.ReadULong64(); CharLoginSQL charLoginSQL = new CharLoginSQL( extendData, netState, (long)iGuid ); WaitExecuteInfo<CharLoginSQL> waitExecuteInfo = new WaitExecuteInfo<CharLoginSQL>( charLoginSQL, WorldPacketHandlers.SQL_HandleCharLogin ); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue( waitExecuteInfo ); }
/// <summary> /// /// </summary> private static void SQL_HandleCharDelete( CharDeleteSQL sqlInfo ) { XPQuery<CharacterBase> characters = new XPQuery<CharacterBase>( OneDatabase.Session ); var characterList = from character in characters where character.Oid == sqlInfo.DelCharGuid select character; bool bIsFinde = false; string strCharacterName = string.Empty; foreach ( CharacterBase character in characterList ) { XPQuery<CharacterPet> creaturePets = new XPQuery<CharacterPet>( OneDatabase.Session ); var creaturePetList = from creaturePet in creaturePets where creaturePet.Owner == character select creaturePet; foreach ( CharacterPet creaturePet in creaturePetList ) creaturePet.Delete(); XPQuery<CharacterItem> characterItems = new XPQuery<CharacterItem>( OneDatabase.Session ); var characterItemList = from characterItem in characterItems where characterItem.Owner == character select characterItem; foreach ( CharacterItem characterItem in characterItemList ) characterItem.Delete(); character.Delete(); OneDatabase.Session.CommitChanges(); strCharacterName = character.CharacterName; bIsFinde = true; break; } if ( bIsFinde == false ) sqlInfo.NetState.Send( new Word_CharDeleteResponseError( ResponseCodes.CHAR_DELETE_FAILED ) ); else { ProcessServer.WowZoneCluster.World.GlobalPlayerInfo.RemovePlayerInfo( strCharacterName ); sqlInfo.NetState.Send( new Word_CharDeleteResponse() ); } CharEnumSQL charEnumSQL = new CharEnumSQL( sqlInfo.WorldExtendData, sqlInfo.NetState ); WaitExecuteInfo<CharEnumSQL> waitExecuteInfo = new WaitExecuteInfo<CharEnumSQL>( charEnumSQL, WorldPacketHandlers.SQL_HandleCharEnum ); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue( waitExecuteInfo ); }
/// </summary> /// /// </summary> private void LoadCreatureRespawn() { WaitExecuteInfo <ExecuteInfoNull> waitExecuteInfo = new WaitExecuteInfo <ExecuteInfoNull>(ExecuteInfoNull.NULL, this.SQL_LoadCreatureRespawn); base.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// </summary> /// /// </summary> private void LoadGlobalPickpocketing() { WaitExecuteInfo <ExecuteInfoNull> waitExecuteInfo = new WaitExecuteInfo <ExecuteInfoNull>(ExecuteInfoNull.NULL, this.SQL_LoadGlobalPickpocketing); base.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// </summary> /// /// </summary> private void LoadGlobalMailInfo() { WaitExecuteInfo <ExecuteInfoNull> waitExecuteInfo = new WaitExecuteInfo <ExecuteInfoNull>(ExecuteInfoNull.NULL, this.SQL_LoadGlobalMailInfo); base.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// <summary> /// /// </summary> private static void SQL_HandleCharDelete(CharDeleteSQL sqlInfo) { XPQuery <CharacterBase> characters = new XPQuery <CharacterBase>(OneDatabase.Session); var characterList = from character in characters where character.Oid == sqlInfo.DelCharGuid select character; bool bIsFinde = false; string strCharacterName = string.Empty; foreach (CharacterBase character in characterList) { XPQuery <CharacterPet> creaturePets = new XPQuery <CharacterPet>(OneDatabase.Session); var creaturePetList = from creaturePet in creaturePets where creaturePet.Owner == character select creaturePet; foreach (CharacterPet creaturePet in creaturePetList) { creaturePet.Delete(); } XPQuery <CharacterItem> characterItems = new XPQuery <CharacterItem>(OneDatabase.Session); var characterItemList = from characterItem in characterItems where characterItem.Owner == character select characterItem; foreach (CharacterItem characterItem in characterItemList) { characterItem.Delete(); } character.Delete(); OneDatabase.Session.CommitChanges(); strCharacterName = character.CharacterName; bIsFinde = true; break; } if (bIsFinde == false) { sqlInfo.NetState.Send(new Word_CharDeleteResponseError(ResponseCodes.CHAR_DELETE_FAILED)); } else { ProcessServer.WowZoneCluster.World.GlobalPlayerInfo.RemovePlayerInfo(strCharacterName); sqlInfo.NetState.Send(new Word_CharDeleteResponse()); } CharEnumSQL charEnumSQL = new CharEnumSQL(sqlInfo.WorldExtendData, sqlInfo.NetState); WaitExecuteInfo <CharEnumSQL> waitExecuteInfo = new WaitExecuteInfo <CharEnumSQL>(charEnumSQL, WorldPacketHandlers.SQL_HandleCharEnum); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }
/// <summary> /// /// </summary> /// <param name="strAccountName"></param> /// <param name="strLastIP"></param> internal static void UpdateAccountLastIP( string strAccountName, string strLastIP ) { UpdateAccountLastIPSQL updateAccountLastIPSQL = new UpdateAccountLastIPSQL( strAccountName, strLastIP ); WaitExecuteInfo<UpdateAccountLastIPSQL> waitExecuteInfo = new WaitExecuteInfo<UpdateAccountLastIPSQL>( updateAccountLastIPSQL, WowAccountHandler.SQL_UpdateAccountLastIP ); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue( waitExecuteInfo ); }
/// <summary> /// /// </summary> internal static void ReloadAccount() { WaitExecuteInfo<ExecuteInfoNull> waitExecuteInfo = new WaitExecuteInfo<ExecuteInfoNull>( ExecuteInfoNull.NULL, WowAccountHandler.SQL_ReloadAccount ); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue( waitExecuteInfo ); }
/// <summary> /// /// </summary> internal static void ReloadAccount() { WaitExecuteInfo <ExecuteInfoNull> waitExecuteInfo = new WaitExecuteInfo <ExecuteInfoNull>(ExecuteInfoNull.NULL, WowAccountHandler.SQL_ReloadAccount); ProcessServer.WowZoneCluster.World.WaitExecute.JoinWaitExecuteQueue(waitExecuteInfo); }