Core: SOme code cleanup, more to follow.

This commit is contained in:
hondacrx
2021-03-20 22:48:48 -04:00
parent 62f554f2e0
commit 62ec699ec6
318 changed files with 5080 additions and 5125 deletions
@@ -66,7 +66,7 @@ namespace Game
if (!_player.MeetPlayerCondition(uiDisplay.AdvGuidePlayerConditionID))
return;
AdventureJournalDataResponse response = new AdventureJournalDataResponse();
AdventureJournalDataResponse response = new();
response.OnLevelUp = updateSuggestions.OnLevelUp;
foreach (var adventureJournal in CliDB.AdventureJournalStorage.Values)
+23 -23
View File
@@ -52,9 +52,9 @@ namespace Game
Log.outDebug(LogFilter.Auctionhouse, $"Auctionhouse search ({browseQuery.Auctioneer}), searchedname: {browseQuery.Name}, levelmin: {browseQuery.MinLevel}, levelmax: {browseQuery.MaxLevel}, filters: {browseQuery.Filters}");
Optional<AuctionSearchClassFilters> classFilters = new Optional<AuctionSearchClassFilters>();
Optional<AuctionSearchClassFilters> classFilters = new();
AuctionListBucketsResult listBucketsResult = new AuctionListBucketsResult();
AuctionListBucketsResult listBucketsResult = new();
if (!browseQuery.ItemClassFilters.Empty())
{
classFilters.HasValue = true;
@@ -128,7 +128,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
if (auctionHouse.BuyCommodity(trans, _player, (uint)confirmCommoditiesPurchase.ItemID, confirmCommoditiesPurchase.Quantity, throttle.DelayUntilNext))
{
AddTransactionCallback(DB.Characters.AsyncCommitTransaction(trans)).AfterComplete(success =>
@@ -184,7 +184,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListBiddedItemsResult result = new AuctionListBiddedItemsResult();
AuctionListBiddedItemsResult result = new();
Player player = GetPlayer();
auctionHouse.BuildListBiddedItems(result, player, listBiddedItems.Offset, listBiddedItems.Sorts, listBiddedItems.Sorts.Count);
@@ -212,7 +212,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListBucketsResult listBucketsResult = new AuctionListBucketsResult();
AuctionListBucketsResult listBucketsResult = new();
auctionHouse.BuildListBuckets(listBucketsResult, _player,
listBucketsByBucketKeys.BucketKeys, listBucketsByBucketKeys.BucketKeys.Count,
@@ -243,7 +243,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListItemsResult listItemsResult = new AuctionListItemsResult();
AuctionListItemsResult listItemsResult = new();
listItemsResult.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
listItemsResult.BucketKey = listItemsByBucketKey.BucketKey;
ItemTemplate itemTemplate = Global.ObjectMgr.GetItemTemplate(listItemsByBucketKey.BucketKey.ItemID);
@@ -275,7 +275,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListItemsResult listItemsResult = new AuctionListItemsResult();
AuctionListItemsResult listItemsResult = new();
listItemsResult.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
listItemsResult.BucketKey.ItemID = listItemsByItemID.ItemID;
ItemTemplate itemTemplate = Global.ObjectMgr.GetItemTemplate(listItemsByItemID.ItemID);
@@ -307,7 +307,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListOwnedItemsResult result = new AuctionListOwnedItemsResult();
AuctionListOwnedItemsResult result = new();
auctionHouse.BuildListOwnedItems(result, _player, listOwnedItems.Offset, listOwnedItems.Sorts, listOwnedItems.Sorts.Count);
result.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
@@ -374,7 +374,7 @@ namespace Game
return;
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
ulong priceToPay = placeBid.BidAmount;
if (!auction.Bidder.IsEmpty())
{
@@ -467,7 +467,7 @@ namespace Game
AuctionPosting auction = auctionHouse.GetAuction(removeItem.AuctionID);
Player player = GetPlayer();
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
if (auction != null && auction.Owner == player.GetGUID())
{
if (auction.Bidder.IsEmpty()) // If we have a bidder, we have to send him the money he paid
@@ -526,7 +526,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionReplicateResponse response = new AuctionReplicateResponse();
AuctionReplicateResponse response = new();
auctionHouse.BuildReplicate(response, GetPlayer(), replicateItems.ChangeNumberGlobal, replicateItems.ChangeNumberCursor, replicateItems.ChangeNumberTombstone, replicateItems.Count);
@@ -588,7 +588,7 @@ namespace Game
// find all items for sale
ulong totalCount = 0;
Dictionary<ObjectGuid, (Item Item, ulong UseCount)> items2 = new Dictionary<ObjectGuid, (Item Item, ulong UseCount)>();
Dictionary<ObjectGuid, (Item Item, ulong UseCount)> items2 = new();
foreach (var itemForSale in sellCommodity.Items)
{
@@ -652,7 +652,7 @@ namespace Game
}
uint auctionId = Global.ObjectMgr.GenerateAuctionID();
AuctionPosting auction = new AuctionPosting();
AuctionPosting auction = new();
auction.Id = auctionId;
auction.Owner = _player.GetGUID();
auction.OwnerAccount = GetAccountGUID();
@@ -662,7 +662,7 @@ namespace Game
auction.EndTime = auction.StartTime + auctionTime;
// keep track of what was cloned to undo/modify counts later
Dictionary<Item, Item> clones = new Dictionary<Item, Item>();
Dictionary<Item, Item> clones = new();
foreach (var pair in items2)
{
Item itemForSale;
@@ -705,7 +705,7 @@ namespace Game
Log.outCommand(GetAccountId(), $"GM {GetPlayerName()} (Account: {GetAccountId()}) create auction: {logItem.GetName(Global.WorldMgr.GetDefaultDbcLocale())} (Entry: {logItem.GetEntry()} Count: {totalCount})");
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
foreach (var pair in items2)
{
@@ -845,7 +845,7 @@ namespace Game
uint auctionId = Global.ObjectMgr.GenerateAuctionID();
AuctionPosting auction = new AuctionPosting();
AuctionPosting auction = new();
auction.Id = auctionId;
auction.Owner = _player.GetGUID();
auction.OwnerAccount = GetAccountGUID();
@@ -874,7 +874,7 @@ namespace Game
_player.MoveItemFromInventory(item.GetBagSlot(), item.GetSlot(), true);
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
item.DeleteFromInventoryDB(trans);
item.SaveToDB(trans);
@@ -902,7 +902,7 @@ namespace Game
if (throttle.Throttled)
return;
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHARACTER_FAVORITE_AUCTION);
stmt.AddValue(0, _player.GetGUID().GetCounter());
@@ -944,7 +944,7 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionGetCommodityQuoteResult commodityQuoteResult = new AuctionGetCommodityQuoteResult();
AuctionGetCommodityQuoteResult commodityQuoteResult = new();
CommodityQuote quote = auctionHouse.CreateCommodityQuote(_player, (uint)getCommodityQuote.ItemID, getCommodityQuote.Quantity);
if (quote != null)
@@ -971,7 +971,7 @@ namespace Game
if (ahEntry == null)
return;
AuctionHelloResponse auctionHelloResponse = new AuctionHelloResponse();
AuctionHelloResponse auctionHelloResponse = new();
auctionHelloResponse.Guid = guid;
auctionHelloResponse.OpenForBusiness = true;
SendPacket(auctionHelloResponse);
@@ -979,7 +979,7 @@ namespace Game
public void SendAuctionCommandResult(uint auctionId, AuctionCommand command, AuctionResult errorCode, TimeSpan delayForNextAction, InventoryResult bagError = 0)
{
AuctionCommandResult auctionCommandResult = new AuctionCommandResult();
AuctionCommandResult auctionCommandResult = new();
auctionCommandResult.AuctionID = auctionId;
auctionCommandResult.Command = (int)command;
auctionCommandResult.ErrorCode = (int)errorCode;
@@ -990,7 +990,7 @@ namespace Game
public void SendAuctionClosedNotification(AuctionPosting auction, float mailDelay, bool sold)
{
AuctionClosedNotification packet = new AuctionClosedNotification();
AuctionClosedNotification packet = new();
packet.Info.Initialize(auction);
packet.ProceedsMailDelay = mailDelay;
packet.Sold = sold;
@@ -999,7 +999,7 @@ namespace Game
public void SendAuctionOwnerBidNotification(AuctionPosting auction)
{
AuctionOwnerBidNotification packet = new AuctionOwnerBidNotification();
AuctionOwnerBidNotification packet = new();
packet.Info.Initialize(auction);
packet.Bidder = auction.Bidder;
packet.MinIncrement = auction.CalculateMinIncrement();
@@ -24,7 +24,7 @@ namespace Game
{
public void SendAuthResponse(BattlenetRpcErrorCode code, bool queued, uint queuePos = 0)
{
AuthResponse response = new AuthResponse();
AuthResponse response = new();
response.Result = code;
if (code == BattlenetRpcErrorCode.Ok)
@@ -62,7 +62,7 @@ namespace Game
{
if (position != 0)
{
WaitQueueUpdate waitQueueUpdate = new WaitQueueUpdate();
WaitQueueUpdate waitQueueUpdate = new();
waitQueueUpdate.WaitInfo.WaitCount = position;
waitQueueUpdate.WaitInfo.WaitTime = 0;
waitQueueUpdate.WaitInfo.HasFCM = false;
@@ -74,7 +74,7 @@ namespace Game
public void SendClientCacheVersion(uint version)
{
ClientCacheVersion cache = new ClientCacheVersion();
ClientCacheVersion cache = new();
cache.CacheVersion = version;
SendPacket(cache);//enabled it
}
@@ -82,7 +82,7 @@ namespace Game
public void SendSetTimeZoneInformation()
{
// @todo: replace dummy values
SetTimeZoneInformation packet = new SetTimeZoneInformation();
SetTimeZoneInformation packet = new();
packet.ServerTimeTZ = "Europe/Paris";
packet.GameTimeTZ = "Europe/Paris";
@@ -91,7 +91,7 @@ namespace Game
public void SendFeatureSystemStatusGlueScreen()
{
FeatureSystemStatusGlueScreen features = new FeatureSystemStatusGlueScreen();
FeatureSystemStatusGlueScreen features = new();
features.BpayStoreAvailable = false;
features.BpayStoreDisabledByParentalControls = false;
features.CharUndeleteEnabled = WorldConfig.GetBoolValue(WorldCfg.FeatureSystemCharacterUndeleteEnabled);
+1 -1
View File
@@ -62,7 +62,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.AzeriteEssenceActivateEssence)]
void HandleAzeriteEssenceActivateEssence(AzeriteEssenceActivateEssence azeriteEssenceActivateEssence)
{
ActivateEssenceFailed activateEssenceResult = new ActivateEssenceFailed();
ActivateEssenceFailed activateEssenceResult = new();
activateEssenceResult.AzeriteEssenceID = azeriteEssenceActivateEssence.AzeriteEssenceID;
Item item = _player.GetItemByEntry(PlayerConst.ItemIdHeartOfAzeroth, ItemSearchLocation.InEquipment);
+4 -4
View File
@@ -39,7 +39,7 @@ namespace Game
if (!item)
return;
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanBankItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item, false);
if (msg != InventoryResult.Ok)
{
@@ -89,7 +89,7 @@ namespace Game
if (Player.IsBankPos(packet.Bag, packet.Slot)) // moving from bank to inventory
{
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item, false);
if (msg != InventoryResult.Ok)
{
@@ -104,7 +104,7 @@ namespace Game
}
else // moving from inventory to bank
{
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanBankItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item, false);
if (msg != InventoryResult.Ok)
{
@@ -146,7 +146,7 @@ namespace Game
public void SendShowBank(ObjectGuid guid)
{
m_currentBankerGUID = guid;
ShowBank packet = new ShowBank();
ShowBank packet = new();
packet.Guid = guid;
SendPacket(packet);
}
+5 -5
View File
@@ -31,7 +31,7 @@ namespace Game
/// <param name="acceptTime">Time in second that the player have for accept</param>
public void SendBfInvitePlayerToWar(ulong queueId, uint zoneId, uint acceptTime)
{
BFMgrEntryInvite bfMgrEntryInvite = new BFMgrEntryInvite();
BFMgrEntryInvite bfMgrEntryInvite = new();
bfMgrEntryInvite.QueueID = queueId;
bfMgrEntryInvite.AreaID = (int)zoneId;
bfMgrEntryInvite.ExpireTime = Time.UnixTime + acceptTime;
@@ -45,7 +45,7 @@ namespace Game
/// <param name="battleState">Battlefield State</param>
public void SendBfInvitePlayerToQueue(ulong queueId, BattlefieldState battleState)
{
BFMgrQueueInvite bfMgrQueueInvite = new BFMgrQueueInvite();
BFMgrQueueInvite bfMgrQueueInvite = new();
bfMgrQueueInvite.QueueID = queueId;
bfMgrQueueInvite.BattleState = battleState;
SendPacket(bfMgrQueueInvite);
@@ -61,7 +61,7 @@ namespace Game
/// <param name="loggingIn">on log in send queue status</param>
public void SendBfQueueInviteResponse(ulong queueId, uint zoneId, BattlefieldState battleStatus, bool canQueue = true, bool loggingIn = false)
{
BFMgrQueueRequestResponse bfMgrQueueRequestResponse = new BFMgrQueueRequestResponse();
BFMgrQueueRequestResponse bfMgrQueueRequestResponse = new();
bfMgrQueueRequestResponse.QueueID = queueId;
bfMgrQueueRequestResponse.AreaID = (int)zoneId;
bfMgrQueueRequestResponse.Result = (sbyte)(canQueue ? 1 : 0);
@@ -78,7 +78,7 @@ namespace Game
/// <param name="onOffense">Whether player belongs to attacking team or not</param>
public void SendBfEntered(ulong queueId, bool relocated, bool onOffense)
{
BFMgrEntering bfMgrEntering = new BFMgrEntering();
BFMgrEntering bfMgrEntering = new();
bfMgrEntering.ClearedAFK = _player.IsAFK();
bfMgrEntering.Relocated = relocated;
bfMgrEntering.OnOffense = onOffense;
@@ -95,7 +95,7 @@ namespace Game
/// <param name="reason">Reason why player left battlefield</param>
public void SendBfLeaveMessage(ulong queueId, BattlefieldState battleState, bool relocated, BFLeaveReason reason = BFLeaveReason.Exited)
{
BFMgrEjected bfMgrEjected = new BFMgrEjected();
BFMgrEjected bfMgrEjected = new();
bfMgrEjected.QueueID = queueId;
bfMgrEjected.Reason = reason;
bfMgrEjected.BattleState = battleState;
+4 -4
View File
@@ -221,7 +221,7 @@ namespace Game
if (bg.IsArena())
return;
PVPMatchStatisticsMessage pvpMatchStatistics = new PVPMatchStatisticsMessage();
PVPMatchStatisticsMessage pvpMatchStatistics = new();
bg.BuildPvPLogDataPacket(out pvpMatchStatistics.Data);
SendPacket(pvpMatchStatistics);
}
@@ -384,7 +384,7 @@ namespace Game
at.SaveToDB();
}
}
BattlefieldStatusNone battlefieldStatus = new BattlefieldStatusNone();
BattlefieldStatusNone battlefieldStatus = new();
battlefieldStatus.Ticket = battlefieldPort.Ticket;
SendPacket(battlefieldStatus);
@@ -581,7 +581,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestRatedPvpInfo)]
void HandleRequestRatedPvpInfo(RequestRatedPvpInfo packet)
{
RatedPvpInfo ratedPvpInfo = new RatedPvpInfo();
RatedPvpInfo ratedPvpInfo = new();
SendPacket(ratedPvpInfo);
}
@@ -589,7 +589,7 @@ namespace Game
void HandleGetPVPOptionsEnabled(GetPVPOptionsEnabled packet)
{
// This packet is completely irrelevant, it triggers PVP_TYPES_ENABLED lua event but that is not handled in interface code as of 6.1.2
PVPOptionsEnabled pvpOptionsEnabled = new PVPOptionsEnabled();
PVPOptionsEnabled pvpOptionsEnabled = new();
pvpOptionsEnabled.PugBattlegrounds = true;
SendPacket(new PVPOptionsEnabled());
}
+4 -4
View File
@@ -43,7 +43,7 @@ namespace Game
{
SetRealmListSecret(changeRealmTicket.Secret);
ChangeRealmTicketResponse realmListTicket = new ChangeRealmTicketResponse();
ChangeRealmTicketResponse realmListTicket = new();
realmListTicket.Token = changeRealmTicket.Token;
realmListTicket.Allow = true;
realmListTicket.Ticket = new Framework.IO.ByteBuffer();
@@ -54,7 +54,7 @@ namespace Game
public void SendBattlenetResponse(uint serviceHash, uint methodId, uint token, IMessage response)
{
Response bnetResponse = new Response();
Response bnetResponse = new();
bnetResponse.BnetStatus = BattlenetRpcErrorCode.Ok;
bnetResponse.Method.Type = MathFunctions.MakePair64(methodId, serviceHash);
bnetResponse.Method.ObjectId = 1;
@@ -68,7 +68,7 @@ namespace Game
public void SendBattlenetResponse(uint serviceHash, uint methodId, uint token, BattlenetRpcErrorCode status)
{
Response bnetResponse = new Response();
Response bnetResponse = new();
bnetResponse.BnetStatus = status;
bnetResponse.Method.Type = MathFunctions.MakePair64(methodId, serviceHash);
bnetResponse.Method.ObjectId = 1;
@@ -85,7 +85,7 @@ namespace Game
public void SendBattlenetRequest(uint serviceHash, uint methodId, IMessage request)
{
Notification notification = new Notification();
Notification notification = new();
notification.Method.Type = MathFunctions.MakePair64(methodId, serviceHash);
notification.Method.ObjectId = 1;
notification.Method.Token = _battlenetRequestToken++;
+6 -6
View File
@@ -45,7 +45,7 @@ namespace Game
void SendBlackMarketOpenResult(ObjectGuid guid, Creature auctioneer)
{
BlackMarketOpenResult packet = new BlackMarketOpenResult();
BlackMarketOpenResult packet = new();
packet.Guid = guid;
packet.Enable = Global.BlackMarketMgr.IsEnabled();
SendPacket(packet);
@@ -64,7 +64,7 @@ namespace Game
return;
}
BlackMarketRequestItemsResult result = new BlackMarketRequestItemsResult();
BlackMarketRequestItemsResult result = new();
Global.BlackMarketMgr.BuildItemsResponse(result, GetPlayer());
SendPacket(result);
}
@@ -119,7 +119,7 @@ namespace Game
return;
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
Global.BlackMarketMgr.SendAuctionOutbidMail(entry, trans);
entry.PlaceBid(blackMarketBidOnItem.BidAmount, player, trans);
@@ -131,7 +131,7 @@ namespace Game
void SendBlackMarketBidOnItemResult(BlackMarketError result, uint marketId, ItemInstance item)
{
BlackMarketBidOnItemResult packet = new BlackMarketBidOnItemResult();
BlackMarketBidOnItemResult packet = new();
packet.MarketID = marketId;
packet.Item = item;
@@ -142,7 +142,7 @@ namespace Game
public void SendBlackMarketWonNotification(BlackMarketEntry entry, Item item)
{
BlackMarketWon packet = new BlackMarketWon();
BlackMarketWon packet = new();
packet.MarketID = entry.GetMarketId();
packet.Item = new ItemInstance(item);
@@ -152,7 +152,7 @@ namespace Game
public void SendBlackMarketOutbidNotification(BlackMarketTemplate templ)
{
BlackMarketOutbid packet = new BlackMarketOutbid();
BlackMarketOutbid packet = new();
packet.MarketID = templ.MarketID;
packet.Item = templ.Item;
+12 -12
View File
@@ -37,13 +37,13 @@ namespace Game
long currTime = Time.UnixTime;
CalendarSendCalendar packet = new CalendarSendCalendar();
CalendarSendCalendar packet = new();
packet.ServerTime = currTime;
var invites = Global.CalendarMgr.GetPlayerInvites(guid);
foreach (var invite in invites)
{
CalendarSendCalendarInviteInfo inviteInfo = new CalendarSendCalendarInviteInfo();
CalendarSendCalendarInviteInfo inviteInfo = new();
inviteInfo.EventID = invite.EventId;
inviteInfo.InviteID = invite.InviteId;
inviteInfo.InviterGuid = invite.SenderGuid;
@@ -126,7 +126,7 @@ namespace Game
if (calendarAddEvent.EventInfo.Time < (Time.UnixTime - 86400L))
return;
CalendarEvent calendarEvent = new CalendarEvent(Global.CalendarMgr.GetFreeEventId(), guid, 0, (CalendarEventType)calendarAddEvent.EventInfo.EventType, calendarAddEvent.EventInfo.TextureID,
CalendarEvent calendarEvent = new(Global.CalendarMgr.GetFreeEventId(), guid, 0, (CalendarEventType)calendarAddEvent.EventInfo.EventType, calendarAddEvent.EventInfo.TextureID,
calendarAddEvent.EventInfo.Time, (CalendarFlags)calendarAddEvent.EventInfo.Flags, calendarAddEvent.EventInfo.Title, calendarAddEvent.EventInfo.Description, 0);
if (calendarEvent.IsGuildEvent() || calendarEvent.IsGuildAnnouncement())
@@ -138,7 +138,7 @@ namespace Game
if (calendarEvent.IsGuildAnnouncement())
{
CalendarInvite invite = new CalendarInvite(0, calendarEvent.EventId, ObjectGuid.Empty, guid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.NotSignedUp, CalendarModerationRank.Player, "");
CalendarInvite invite = new(0, calendarEvent.EventId, ObjectGuid.Empty, guid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.NotSignedUp, CalendarModerationRank.Player, "");
// WARNING: By passing pointer to a local variable, the underlying method(s) must NOT perform any kind
// of storage of the pointer as it will lead to memory corruption
Global.CalendarMgr.AddInvite(calendarEvent, invite);
@@ -151,7 +151,7 @@ namespace Game
for (int i = 0; i < calendarAddEvent.EventInfo.Invites.Length; ++i)
{
CalendarInvite invite = new CalendarInvite(Global.CalendarMgr.GetFreeInviteId(), calendarEvent.EventId,
CalendarInvite invite = new(Global.CalendarMgr.GetFreeInviteId(), calendarEvent.EventId,
calendarAddEvent.EventInfo.Invites[i].Guid, guid, SharedConst.CalendarDefaultResponseTime, (CalendarInviteStatus)calendarAddEvent.EventInfo.Invites[i].Status,
(CalendarModerationRank)calendarAddEvent.EventInfo.Invites[i].Moderator, "");
Global.CalendarMgr.AddInvite(calendarEvent, invite, trans);
@@ -214,7 +214,7 @@ namespace Game
CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID);
if (oldEvent != null)
{
CalendarEvent newEvent = new CalendarEvent(oldEvent, Global.CalendarMgr.GetFreeEventId());
CalendarEvent newEvent = new(oldEvent, Global.CalendarMgr.GetFreeEventId());
newEvent.Date = calendarCopyEvent.Date;
Global.CalendarMgr.AddEvent(newEvent, CalendarSendEventType.Copy);
@@ -305,7 +305,7 @@ namespace Game
return;
}
CalendarInvite invite = new CalendarInvite(Global.CalendarMgr.GetFreeInviteId(), calendarInvite.EventID, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
CalendarInvite invite = new(Global.CalendarMgr.GetFreeInviteId(), calendarInvite.EventID, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
Global.CalendarMgr.AddInvite(calendarEvent, invite);
}
else
@@ -319,7 +319,7 @@ namespace Game
return;
}
CalendarInvite invite = new CalendarInvite(calendarInvite.EventID, 0, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
CalendarInvite invite = new(calendarInvite.EventID, 0, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
Global.CalendarMgr.SendCalendarEventInvite(invite);
}
}
@@ -339,7 +339,7 @@ namespace Game
}
CalendarInviteStatus status = calendarEventSignUp.Tentative ? CalendarInviteStatus.Tentative : CalendarInviteStatus.SignedUp;
CalendarInvite invite = new CalendarInvite(Global.CalendarMgr.GetFreeInviteId(), calendarEventSignUp.EventID, guid, guid, Time.UnixTime, status, CalendarModerationRank.Player, "");
CalendarInvite invite = new(Global.CalendarMgr.GetFreeInviteId(), calendarEventSignUp.EventID, guid, guid, Time.UnixTime, status, CalendarModerationRank.Player, "");
Global.CalendarMgr.AddInvite(calendarEvent, invite);
Global.CalendarMgr.SendCalendarClearPendingAction(guid);
}
@@ -495,7 +495,7 @@ namespace Game
if (add)
{
CalendarRaidLockoutAdded calendarRaidLockoutAdded = new CalendarRaidLockoutAdded();
CalendarRaidLockoutAdded calendarRaidLockoutAdded = new();
calendarRaidLockoutAdded.InstanceID = save.GetInstanceId();
calendarRaidLockoutAdded.ServerTime = (uint)currTime;
calendarRaidLockoutAdded.MapID = (int)save.GetMapId();
@@ -505,7 +505,7 @@ namespace Game
}
else
{
CalendarRaidLockoutRemoved calendarRaidLockoutRemoved = new CalendarRaidLockoutRemoved();
CalendarRaidLockoutRemoved calendarRaidLockoutRemoved = new();
calendarRaidLockoutRemoved.InstanceID = save.GetInstanceId();
calendarRaidLockoutRemoved.MapID = (int)save.GetMapId();
calendarRaidLockoutRemoved.DifficultyID = save.GetDifficultyID();
@@ -520,7 +520,7 @@ namespace Game
long currTime = Time.UnixTime;
CalendarRaidLockoutUpdated packet = new CalendarRaidLockoutUpdated();
CalendarRaidLockoutUpdated packet = new();
packet.DifficultyID = (uint)save.GetDifficultyID();
packet.MapID = (int)save.GetMapId();
packet.NewTimeRemaining = 0; // FIXME
+42 -42
View File
@@ -42,7 +42,7 @@ namespace Game
DB.Characters.Execute(stmt);
// get all the data necessary for loading all characters (along with their pets) on the account
EnumCharactersQueryHolder holder = new EnumCharactersQueryHolder();
EnumCharactersQueryHolder holder = new();
if (!holder.Initialize(GetAccountId(), WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed), false))
{
HandleCharEnum(holder);
@@ -54,7 +54,7 @@ namespace Game
void HandleCharEnum(EnumCharactersQueryHolder holder)
{
EnumCharactersResult charResult = new EnumCharactersResult();
EnumCharactersResult charResult = new();
charResult.Success = true;
charResult.IsDeletedCharacters = holder.IsDeletedCharacters();
charResult.DisabledClassesMask.Set(WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask));
@@ -62,13 +62,13 @@ namespace Game
if (!charResult.IsDeletedCharacters)
_legitCharacters.Clear();
MultiMap<ulong, ChrCustomizationChoice> customizations = new MultiMap<ulong, ChrCustomizationChoice>();
MultiMap<ulong, ChrCustomizationChoice> customizations = new();
SQLResult customizationsResult = holder.GetResult(EnumCharacterQueryLoad.Customizations);
if (!customizationsResult.IsEmpty())
{
do
{
ChrCustomizationChoice choice = new ChrCustomizationChoice();
ChrCustomizationChoice choice = new();
choice.ChrCustomizationOptionID = customizationsResult.Read<uint>(1);
choice.ChrCustomizationChoiceID = customizationsResult.Read<uint>(2);
customizations.Add(customizationsResult.Read<ulong>(0), choice);
@@ -81,7 +81,7 @@ namespace Game
{
do
{
EnumCharactersResult.CharacterInfo charInfo = new EnumCharactersResult.CharacterInfo(result.GetFields());
EnumCharactersResult.CharacterInfo charInfo = new(result.GetFields());
var customizationsForChar = customizations.LookupByKey(charInfo.Guid.GetCounter());
if (!customizationsForChar.Empty())
@@ -126,7 +126,7 @@ namespace Game
foreach (var requirement in Global.ObjectMgr.GetRaceUnlockRequirements())
{
EnumCharactersResult.RaceUnlock raceUnlock = new EnumCharactersResult.RaceUnlock();
EnumCharactersResult.RaceUnlock raceUnlock = new();
raceUnlock.RaceID = requirement.Key;
raceUnlock.HasExpansion = (byte)GetAccountExpansion() >= requirement.Value.Expansion;
raceUnlock.HasAchievement = requirement.Value.AchievementId != 0 /*|| HasAchievement(requirement.Value.AchievementId)*/;
@@ -140,7 +140,7 @@ namespace Game
void HandleCharUndeleteEnum(EnumCharacters enumCharacters)
{
// get all the data necessary for loading all undeleted characters (along with their pets) on the account
EnumCharactersQueryHolder holder = new EnumCharactersQueryHolder();
EnumCharactersQueryHolder holder = new();
if (!holder.Initialize(GetAccountId(), WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed), true))
{
HandleCharEnum(holder);
@@ -152,7 +152,7 @@ namespace Game
void HandleCharUndeleteEnumCallback(SQLResult result)
{
EnumCharactersResult charEnum = new EnumCharactersResult();
EnumCharactersResult charEnum = new();
charEnum.Success = true;
charEnum.IsDeletedCharacters = true;
charEnum.DisabledClassesMask.Set(WorldConfig.GetUIntValue(WorldCfg.CharacterCreatingDisabledClassmask));
@@ -161,7 +161,7 @@ namespace Game
{
do
{
EnumCharactersResult.CharacterInfo charInfo = new EnumCharactersResult.CharacterInfo(result.GetFields());
EnumCharactersResult.CharacterInfo charInfo = new(result.GetFields());
Log.outInfo(LogFilter.Network, "Loading undeleted char guid {0} from account {1}.", charInfo.Guid.ToString(), GetAccountId());
@@ -508,7 +508,7 @@ namespace Game
return;
}
Player newChar = new Player(this);
Player newChar = new(this);
newChar.GetMotionMaster().Initialize();
if (!newChar.Create(Global.ObjectMgr.GetGenerator(HighGuid.Player).Generate(), createInfo))
{
@@ -524,8 +524,8 @@ namespace Game
newChar.atLoginFlags = AtLoginFlags.FirstLogin; // First login
SQLTransaction characterTransaction = new SQLTransaction();
SQLTransaction loginTransaction = new SQLTransaction();
SQLTransaction characterTransaction = new();
SQLTransaction loginTransaction = new();
// Player created, save it now
newChar.SaveToDB(loginTransaction, characterTransaction, true);
@@ -648,7 +648,7 @@ namespace Game
return;
}
GenerateRandomCharacterNameResult result = new GenerateRandomCharacterNameResult();
GenerateRandomCharacterNameResult result = new();
result.Success = true;
result.Name = Global.DB2Mgr.GetNameGenEntry(packet.Race, packet.Sex);
@@ -658,7 +658,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.ReorderCharacters, Status = SessionStatus.Authed)]
void HandleReorderCharacters(ReorderCharacters reorderChars)
{
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
foreach (var reorderInfo in reorderChars.Entries)
{
@@ -702,7 +702,7 @@ namespace Game
return;
}
LoginQueryHolder holder = new LoginQueryHolder(GetAccountId(), m_playerLoading);
LoginQueryHolder holder = new(GetAccountId(), m_playerLoading);
holder.Initialize();
SendPacket(new ResumeComms(ConnectionType.Instance));
@@ -714,7 +714,7 @@ namespace Game
{
ObjectGuid playerGuid = holder.GetGuid();
Player pCurrChar = new Player(this);
Player pCurrChar = new(this);
if (!pCurrChar.LoadFromDB(playerGuid, holder))
{
SetPlayer(null);
@@ -730,14 +730,14 @@ namespace Game
pCurrChar.GetMotionMaster().Initialize();
pCurrChar.SendDungeonDifficulty();
LoginVerifyWorld loginVerifyWorld = new LoginVerifyWorld();
LoginVerifyWorld loginVerifyWorld = new();
loginVerifyWorld.MapID = (int)pCurrChar.GetMapId();
loginVerifyWorld.Pos = pCurrChar.GetPosition();
SendPacket(loginVerifyWorld);
LoadAccountData(holder.GetResult(PlayerLoginQueryLoad.AccountData), AccountDataTypes.PerCharacterCacheMask);
AccountDataTimes accountDataTimes = new AccountDataTimes();
AccountDataTimes accountDataTimes = new();
accountDataTimes.PlayerGuid = playerGuid;
accountDataTimes.ServerTime = (uint)GameTime.GetGameTime();
for (AccountDataTypes i = 0; i < AccountDataTypes.Max; ++i)
@@ -747,7 +747,7 @@ namespace Game
SendFeatureSystemStatus();
MOTD motd = new MOTD();
MOTD motd = new();
motd.Text = Global.WorldMgr.GetMotd();
SendPacket(motd);
@@ -755,7 +755,7 @@ namespace Game
// Send PVPSeason
{
SeasonInfo seasonInfo = new SeasonInfo();
SeasonInfo seasonInfo = new();
seasonInfo.PreviousSeason = (WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId) - (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress) ? 1 : 0));
if (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress))
@@ -855,12 +855,12 @@ namespace Game
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt)).WithCallback(favoriteAuctionResult =>
{
AuctionFavoriteList favoriteItems = new AuctionFavoriteList();
AuctionFavoriteList favoriteItems = new();
if (!favoriteAuctionResult.IsEmpty())
{
do
{
AuctionFavoriteInfo item = new AuctionFavoriteInfo();
AuctionFavoriteInfo item = new();
item.Order = favoriteAuctionResult.Read<uint>(0);
item.ItemID = favoriteAuctionResult.Read<uint>(1);
item.ItemLevel = favoriteAuctionResult.Read<uint>(2);
@@ -1049,7 +1049,7 @@ namespace Game
public void SendFeatureSystemStatus()
{
FeatureSystemStatus features = new FeatureSystemStatus();
FeatureSystemStatus features = new();
// START OF DUMMY VALUES
features.ComplaintStatus = 2;
@@ -1239,7 +1239,7 @@ namespace Game
}
atLoginFlags &= ~AtLoginFlags.Rename;
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
ulong lowGuid = renameInfo.Guid.GetCounter();
// Update name and at_login flag in the db
@@ -1298,7 +1298,7 @@ namespace Game
packet.DeclinedNames.name[i] = declinedName;
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_DECLINED_NAME);
stmt.AddValue(0, packet.Player.GetCounter());
@@ -1450,7 +1450,7 @@ namespace Game
}
PreparedStatement stmt;
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
ulong lowGuid = customizeInfo.CharGUID.GetCounter();
// Customize
@@ -1582,7 +1582,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.UseEquipmentSet)]
void HandleUseEquipmentSet(UseEquipmentSet useEquipmentSet)
{
ObjectGuid ignoredItemGuid = new ObjectGuid(0x0C00040000000000, 0xFFFFFFFFFFFFFFFF);
ObjectGuid ignoredItemGuid = new(0x0C00040000000000, 0xFFFFFFFFFFFFFFFF);
for (byte i = 0; i < EquipmentSlot.End; ++i)
{
Log.outDebug(LogFilter.Player, "{0}: ContainerSlot: {1}, Slot: {2}", useEquipmentSet.Items[i].Item.ToString(), useEquipmentSet.Items[i].ContainerSlot, useEquipmentSet.Items[i].Slot);
@@ -1604,7 +1604,7 @@ namespace Game
if (!uItem)
continue;
List<ItemPosCount> itemPosCount = new List<ItemPosCount>();
List<ItemPosCount> itemPosCount = new();
InventoryResult inventoryResult = GetPlayer().CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, itemPosCount, uItem, false);
if (inventoryResult == InventoryResult.Ok)
{
@@ -1629,7 +1629,7 @@ namespace Game
GetPlayer().SwapItem(item.GetPos(), dstPos);
}
UseEquipmentSetResult result = new UseEquipmentSetResult();
UseEquipmentSetResult result = new();
result.GUID = useEquipmentSet.GUID;
result.Reason = 0; // 4 - equipment swap failed - inventory is full
SendPacket(result);
@@ -1761,7 +1761,7 @@ namespace Game
ulong lowGuid = factionChangeInfo.Guid.GetCounter();
PreparedStatement stmt;
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
// resurrect the character in case he's dead
Player.OfflineResurrect(factionChangeInfo.Guid, trans);
@@ -2089,7 +2089,7 @@ namespace Game
// Title conversion
if (!string.IsNullOrEmpty(knownTitlesStr))
{
List<uint> knownTitles = new List<uint>();
List<uint> knownTitles = new();
var tokens = new StringArray(knownTitlesStr, ' ');
for (int index = 0; index < tokens.Length; ++index)
@@ -2339,7 +2339,7 @@ namespace Game
uint zoneId = GetPlayer().GetZoneId();
uint team = (uint)GetPlayer().GetTeam();
List<uint> graveyardIds = new List<uint>();
List<uint> graveyardIds = new();
var range = Global.ObjectMgr.GraveYardStorage.LookupByKey(zoneId);
for (uint i = 0; i < range.Count && graveyardIds.Count < 16; ++i) // client max
@@ -2356,7 +2356,7 @@ namespace Game
return;
}
RequestCemeteryListResponse packet = new RequestCemeteryListResponse();
RequestCemeteryListResponse packet = new();
packet.IsGossipTriggered = false;
foreach (uint id in graveyardIds)
@@ -2439,7 +2439,7 @@ namespace Game
void SendCharCreate(ResponseCodes result, ObjectGuid guid = default)
{
CreateChar response = new CreateChar();
CreateChar response = new();
response.Code = result;
response.Guid = guid;
@@ -2448,7 +2448,7 @@ namespace Game
void SendCharDelete(ResponseCodes result)
{
DeleteChar response = new DeleteChar();
DeleteChar response = new();
response.Code = result;
SendPacket(response);
@@ -2456,7 +2456,7 @@ namespace Game
void SendCharRename(ResponseCodes result, CharacterRenameInfo renameInfo)
{
CharacterRenameResult packet = new CharacterRenameResult();
CharacterRenameResult packet = new();
packet.Result = result;
packet.Name = renameInfo.NewName;
if (result == ResponseCodes.Success)
@@ -2469,12 +2469,12 @@ namespace Game
{
if (result == ResponseCodes.Success)
{
CharCustomizeSuccess response = new CharCustomizeSuccess(customizeInfo);
CharCustomizeSuccess response = new(customizeInfo);
SendPacket(response);
}
else
{
CharCustomizeFailure failed = new CharCustomizeFailure();
CharCustomizeFailure failed = new();
failed.Result = (byte)result;
failed.CharGUID = customizeInfo.CharGUID;
SendPacket(failed);
@@ -2483,7 +2483,7 @@ namespace Game
void SendCharFactionChange(ResponseCodes result, CharRaceOrFactionChangeInfo factionChangeInfo)
{
CharFactionChangeResult packet = new CharFactionChangeResult();
CharFactionChangeResult packet = new();
packet.Result = result;
packet.Guid = factionChangeInfo.Guid;
@@ -2501,7 +2501,7 @@ namespace Game
void SendSetPlayerDeclinedNamesResult(DeclinedNameResult result, ObjectGuid guid)
{
SetPlayerDeclinedNamesResult packet = new SetPlayerDeclinedNamesResult();
SetPlayerDeclinedNamesResult packet = new();
packet.ResultCode = result;
packet.Player = guid;
@@ -2510,7 +2510,7 @@ namespace Game
void SendUndeleteCooldownStatusResponse(uint currentCooldown, uint maxCooldown)
{
UndeleteCooldownStatusResponse response = new UndeleteCooldownStatusResponse();
UndeleteCooldownStatusResponse response = new();
response.OnCooldown = (currentCooldown > 0);
response.MaxCooldown = maxCooldown;
response.CurrentCooldown = currentCooldown;
@@ -2520,7 +2520,7 @@ namespace Game
void SendUndeleteCharacterResponse(CharacterUndeleteResult result, CharacterUndeleteInfo undeleteInfo)
{
UndeleteCharacterResponse response = new UndeleteCharacterResponse();
UndeleteCharacterResponse response = new();
response.UndeleteInfo = undeleteInfo;
response.Result = result;
+7 -7
View File
@@ -282,7 +282,7 @@ namespace Game
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group);
ChatPkt data = new ChatPkt();
ChatPkt data = new();
data.Initialize(type, lang, sender, null, msg);
group.BroadcastPacket(data, false, group.GetMemberGroup(GetPlayer().GetGUID()));
}
@@ -322,7 +322,7 @@ namespace Game
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group);
ChatPkt data = new ChatPkt();
ChatPkt data = new();
data.Initialize(type, lang, sender, null, msg);
group.BroadcastPacket(data, false);
}
@@ -335,7 +335,7 @@ namespace Game
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group);
ChatPkt data = new ChatPkt();
ChatPkt data = new();
//in Battleground, raid warning is sent only to players in Battleground - code is ok
data.Initialize(ChatMsg.RaidWarning, lang, sender, null, msg);
group.BroadcastPacket(data, false);
@@ -368,7 +368,7 @@ namespace Game
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group);
ChatPkt packet = new ChatPkt();
ChatPkt packet = new();
packet.Initialize(type, lang, sender, null, msg);
group.BroadcastPacket(packet, false);
break;
@@ -449,7 +449,7 @@ namespace Game
subGroup = sender.GetSubGroup();
}
ChatPkt data = new ChatPkt();
ChatPkt data = new();
data.Initialize(type, isLogged ? Language.AddonLogged : Language.Addon, sender, null, text, 0, "", Locale.enUS, prefix);
group.BroadcastAddonMessagePacket(data, prefix, true, subGroup, sender.GetGUID());
break;
@@ -592,7 +592,7 @@ namespace Game
break;
}
STextEmote textEmote = new STextEmote();
STextEmote textEmote = new();
textEmote.SourceGUID = GetPlayer().GetGUID();
textEmote.SourceAccountGUID = GetAccountGUID();
textEmote.TargetGUID = packet.Target;
@@ -620,7 +620,7 @@ namespace Game
if (!player || player.GetSession() == null)
return;
ChatPkt data = new ChatPkt();
ChatPkt data = new();
data.Initialize(ChatMsg.Ignored, Language.Universal, GetPlayer(), GetPlayer(), GetPlayer().GetName());
player.SendPacket(data);
}
+2 -2
View File
@@ -32,7 +32,7 @@ namespace Game
if (!player)
return;
CanDuelResult response = new CanDuelResult();
CanDuelResult response = new();
response.TargetGUID = packet.TargetGUID;
response.Result = player.duel == null;
SendPacket(response);
@@ -73,7 +73,7 @@ namespace Game
player.duel.startTimer = now;
plTarget.duel.startTimer = now;
DuelCountdown packet = new DuelCountdown(3000);
DuelCountdown packet = new(3000);
player.SendPacket(packet);
plTarget.SendPacket(packet);
+6 -6
View File
@@ -27,7 +27,7 @@ namespace Game
{
public void SendPartyResult(PartyOperation operation, string member, PartyResult res, uint val = 0)
{
PartyCommandResult packet = new PartyCommandResult();
PartyCommandResult packet = new();
packet.Name = member;
packet.Command = (byte)operation;
@@ -232,7 +232,7 @@ namespace Game
return;
// report
GroupDecline decline = new GroupDecline(GetPlayer().GetName());
GroupDecline decline = new(GetPlayer().GetName());
leader.SendPacket(decline);
}
}
@@ -294,7 +294,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.SetRole, Processing = PacketProcessing.Inplace)]
void HandleSetRole(SetRole packet)
{
RoleChangedInform roleChangedInform = new RoleChangedInform();
RoleChangedInform roleChangedInform = new();
Group group = GetPlayer().GetGroup();
byte oldRole = (byte)(group ? group.GetLfgRoles(packet.TargetGUID) : 0);
@@ -407,7 +407,7 @@ namespace Game
if (!GetPlayer().GetGroup())
return;
MinimapPing minimapPing = new MinimapPing();
MinimapPing minimapPing = new();
minimapPing.Sender = GetPlayer().GetGUID();
minimapPing.PositionX = packet.PositionX;
minimapPing.PositionY = packet.PositionY;
@@ -586,7 +586,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestPartyMemberStats)]
void HandleRequestPartyMemberStats(RequestPartyMemberStats packet)
{
PartyMemberFullState partyMemberStats = new PartyMemberFullState();
PartyMemberFullState partyMemberStats = new();
Player player = Global.ObjAccessor.FindConnectedPlayer(packet.TargetGUID);
if (!player)
@@ -632,7 +632,7 @@ namespace Game
if (!group.IsLeader(guid) && !group.IsAssistant(guid))
return;
RolePollInform rolePollInform = new RolePollInform();
RolePollInform rolePollInform = new();
rolePollInform.From = guid;
rolePollInform.PartyIndex = packet.PartyIndex;
group.BroadcastPacket(rolePollInform, true);
+10 -10
View File
@@ -43,7 +43,7 @@ namespace Game
if (!lfGuildAddRecruit.PlayStyle.HasAnyFlag((uint)GuildFinderOptionsInterest.All) || lfGuildAddRecruit.PlayStyle > (uint)GuildFinderOptionsInterest.All)
return;
MembershipRequest request = new MembershipRequest(GetPlayer().GetGUID(), lfGuildAddRecruit.GuildGUID, lfGuildAddRecruit.Availability,
MembershipRequest request = new(GetPlayer().GetGUID(), lfGuildAddRecruit.GuildGUID, lfGuildAddRecruit.Availability,
lfGuildAddRecruit.ClassRoles, lfGuildAddRecruit.PlayStyle, lfGuildAddRecruit.Comment, Time.UnixTime);
Global.GuildFinderMgr.AddMembershipRequest(lfGuildAddRecruit.GuildGUID, request);
}
@@ -62,14 +62,14 @@ namespace Game
Player player = GetPlayer();
LFGuildPlayer settings = new LFGuildPlayer(player.GetGUID(), lfGuildBrowse.ClassRoles, lfGuildBrowse.Availability, lfGuildBrowse.PlayStyle, (uint)GuildFinderOptionsLevel.Any);
LFGuildPlayer settings = new(player.GetGUID(), lfGuildBrowse.ClassRoles, lfGuildBrowse.Availability, lfGuildBrowse.PlayStyle, (uint)GuildFinderOptionsLevel.Any);
var guildList = Global.GuildFinderMgr.GetGuildsMatchingSetting(settings, (uint)player.GetTeam());
LFGuildBrowseResult lfGuildBrowseResult = new LFGuildBrowseResult();
LFGuildBrowseResult lfGuildBrowseResult = new();
for (var i = 0; i < guildList.Count; ++i)
{
LFGuildSettings guildSettings = guildList[i];
LFGuildBrowseData guildData = new LFGuildBrowseData();
LFGuildBrowseData guildData = new();
Guild guild = Global.GuildMgr.GetGuildByGuid(guildSettings.GetGUID());
guildData.GuildName = guild.GetName();
@@ -112,13 +112,13 @@ namespace Game
void HandleGuildFinderGetApplications(LFGuildGetApplications lfGuildGetApplications)
{
List<MembershipRequest> applicatedGuilds = Global.GuildFinderMgr.GetAllMembershipRequestsForPlayer(GetPlayer().GetGUID());
LFGuildApplications lfGuildApplications = new LFGuildApplications();
LFGuildApplications lfGuildApplications = new();
lfGuildApplications.NumRemaining = 10 - Global.GuildFinderMgr.CountRequestsFromPlayer(GetPlayer().GetGUID());
for (var i = 0; i < applicatedGuilds.Count; ++i)
{
MembershipRequest application = applicatedGuilds[i];
LFGuildApplicationData applicationData = new LFGuildApplicationData();
LFGuildApplicationData applicationData = new();
Guild guild = Global.GuildMgr.GetGuildByGuid(application.GetGuildGuid());
LFGuildSettings guildSettings = Global.GuildFinderMgr.GetGuildSettings(application.GetGuildGuid());
@@ -148,7 +148,7 @@ namespace Game
if (!guild) // Player must be in guild
return;
LFGuildPost lfGuildPost = new LFGuildPost();
LFGuildPost lfGuildPost = new();
if (guild.GetLeaderGUID() == player.GetGUID())
{
LFGuildSettings settings = Global.GuildFinderMgr.GetGuildSettings(guild.GetGUID());
@@ -177,14 +177,14 @@ namespace Game
return;
long now = Time.UnixTime;
LFGuildRecruits lfGuildRecruits = new LFGuildRecruits();
LFGuildRecruits lfGuildRecruits = new();
lfGuildRecruits.UpdateTime = now;
var recruitsList = Global.GuildFinderMgr.GetAllMembershipRequestsForGuild(guild.GetGUID());
if (recruitsList != null)
{
foreach (var recruitRequestPair in recruitsList)
{
LFGuildRecruitData recruitData = new LFGuildRecruitData();
LFGuildRecruitData recruitData = new();
recruitData.RecruitGUID = recruitRequestPair.Key;
recruitData.RecruitVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
recruitData.Comment = recruitRequestPair.Value.GetComment();
@@ -248,7 +248,7 @@ namespace Game
if (guild.GetLeaderGUID() != player.GetGUID())
return;
LFGuildSettings settings = new LFGuildSettings(lfGuildSetGuildPost.Active, (uint)player.GetTeam(), player.GetGuild().GetGUID(), lfGuildSetGuildPost.ClassRoles,
LFGuildSettings settings = new(lfGuildSetGuildPost.Active, (uint)player.GetTeam(), player.GetGuild().GetGUID(), lfGuildSetGuildPost.ClassRoles,
lfGuildSetGuildPost.Availability, lfGuildSetGuildPost.PlayStyle, lfGuildSetGuildPost.LevelRange, lfGuildSetGuildPost.Comment);
Global.GuildFinderMgr.SetGuildSettings(player.GetGuild().GetGUID(), settings);
}
+4 -4
View File
@@ -38,7 +38,7 @@ namespace Game
}
}
QueryGuildInfoResponse response = new QueryGuildInfoResponse();
QueryGuildInfoResponse response = new();
response.GuildGUID = query.GuildGuid;
response.PlayerGuid = query.PlayerGuid;
SendPacket(response);
@@ -185,7 +185,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.SaveGuildEmblem)]
void HandleSaveGuildEmblem(SaveGuildEmblem packet)
{
Guild.EmblemInfo emblemInfo = new Guild.EmblemInfo();
Guild.EmblemInfo emblemInfo = new();
emblemInfo.ReadPacket(packet);
if (GetPlayer().GetNPCIfCanInteractWith(packet.Vendor, NPCFlags.TabardDesigner, NPCFlags2.None))
@@ -407,12 +407,12 @@ namespace Game
{
var rewards = Global.GuildMgr.GetGuildRewards();
GuildRewardList rewardList = new GuildRewardList();
GuildRewardList rewardList = new();
rewardList.Version = (uint)Time.UnixTime;
for (int i = 0; i < rewards.Count; i++)
{
GuildRewardItem rewardItem = new GuildRewardItem();
GuildRewardItem rewardItem = new();
rewardItem.ItemID = rewards[i].ItemID;
rewardItem.RaceMask = (uint)rewards[i].RaceMask;
rewardItem.MinGuildLevel = 0;
+3 -3
View File
@@ -32,7 +32,7 @@ namespace Game
foreach (DBQueryBulk.DBQueryRecord record in dbQuery.Queries)
{
DBReply dbReply = new DBReply();
DBReply dbReply = new();
dbReply.TableHash = dbQuery.TableHash;
dbReply.RecordID = record.RecordID;
@@ -69,13 +69,13 @@ namespace Game
{
var hotfixes = Global.DB2Mgr.GetHotfixData();
HotfixConnect hotfixQueryResponse = new HotfixConnect();
HotfixConnect hotfixQueryResponse = new();
foreach (HotfixRecord hotfixRecord in hotfixQuery.Hotfixes)
{
var serverHotfixIndex = hotfixes.IndexOf(hotfixRecord);
if (serverHotfixIndex != -1)
{
HotfixConnect.HotfixData hotfixData = new HotfixConnect.HotfixData();
HotfixConnect.HotfixData hotfixData = new();
hotfixData.Record = hotfixes[serverHotfixIndex];
if (hotfixData.Record.HotfixStatus == HotfixRecord.Status.Valid)
{
+1 -1
View File
@@ -42,7 +42,7 @@ namespace Game
if (GetPlayer().IsValidAttackTarget(player))
return;
InspectResult inspectResult = new InspectResult();
InspectResult inspectResult = new();
inspectResult.DisplayInfo.Initialize(player);
if (GetPlayer().CanBeGameMaster() || WorldConfig.GetIntValue(WorldCfg.TalentsInspecting) + (GetPlayer().GetTeamId() == player.GetTeamId() ? 1 : 0) > 1)
+7 -7
View File
@@ -229,7 +229,7 @@ namespace Game
if (!dstItem.HasItemFlag(ItemFieldFlags.Child))
{
// check dest.src move possibility
List<ItemPosCount> sSrc = new List<ItemPosCount>();
List<ItemPosCount> sSrc = new();
ushort eSrc = 0;
if (pl.IsInventoryPos(src))
{
@@ -353,7 +353,7 @@ namespace Game
InventoryResult msg = _player.CanUseItem(item);
if (msg == InventoryResult.Ok)
{
ReadItemResultOK packet = new ReadItemResultOK();
ReadItemResultOK packet = new();
packet.Item = item.GetGUID();
SendPacket(packet);
}
@@ -515,7 +515,7 @@ namespace Game
return;
}
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = _player.CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, dest, pItem, false);
if (msg == InventoryResult.Ok)
{
@@ -594,7 +594,7 @@ namespace Game
}
}
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
msg = GetPlayer().CanStoreItem(packet.ContainerSlotB, ItemConst.NullSlot, dest, item, false);
if (msg != InventoryResult.Ok)
{
@@ -616,7 +616,7 @@ namespace Game
public void SendEnchantmentLog(ObjectGuid owner, ObjectGuid caster, ObjectGuid itemGuid, uint itemId, uint enchantId, uint enchantSlot)
{
EnchantmentLog packet = new EnchantmentLog();
EnchantmentLog packet = new();
packet.Owner = owner;
packet.Caster = caster;
packet.ItemGUID = itemGuid;
@@ -629,7 +629,7 @@ namespace Game
public void SendItemEnchantTimeUpdate(ObjectGuid Playerguid, ObjectGuid Itemguid, uint slot, uint Duration)
{
ItemEnchantTimeUpdate data = new ItemEnchantTimeUpdate();
ItemEnchantTimeUpdate data = new();
data.ItemGuid = Itemguid;
data.DurationLeft = Duration;
data.Slot = slot;
@@ -716,7 +716,7 @@ namespace Game
return;
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_CHAR_GIFT);
stmt.AddValue(0, item.GetOwnerGUID().GetCounter());
+13 -13
View File
@@ -43,7 +43,7 @@ namespace Game
return;
}
List<uint> newDungeons = new List<uint>();
List<uint> newDungeons = new();
foreach (uint slot in dfJoin.Slots)
{
uint dungeon = slot & 0x00FFFFFF;
@@ -147,7 +147,7 @@ namespace Game
uint contentTuningReplacementConditionMask = GetPlayer().m_playerData.CtrOptions.GetValue().ContentTuningConditionMask;
var randomDungeons = Global.LFGMgr.GetRandomAndSeasonalDungeons(level, (uint)GetExpansion(), contentTuningReplacementConditionMask);
LfgPlayerInfo lfgPlayerInfo = new LfgPlayerInfo();
LfgPlayerInfo lfgPlayerInfo = new();
// Get player locked Dungeons
foreach (var locked in Global.LFGMgr.GetLockedDungeons(_player.GetGUID()))
@@ -216,7 +216,7 @@ namespace Game
if (!group)
return;
LfgPartyInfo lfgPartyInfo = new LfgPartyInfo();
LfgPartyInfo lfgPartyInfo = new();
// Get the Locked dungeons of the other party members
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
@@ -229,7 +229,7 @@ namespace Game
if (pguid == guid)
continue;
LFGBlackList lfgBlackList = new LFGBlackList();
LFGBlackList lfgBlackList = new();
lfgBlackList.PlayerGuid.Set(pguid);
foreach (var locked in Global.LFGMgr.GetLockedDungeons(pguid))
lfgBlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel, 0));
@@ -267,7 +267,7 @@ namespace Game
break;
}
LFGUpdateStatus lfgUpdateStatus = new LFGUpdateStatus();
LFGUpdateStatus lfgUpdateStatus = new();
RideTicket ticket = Global.LFGMgr.GetTicket(_player.GetGUID());
if (ticket != null)
@@ -293,7 +293,7 @@ namespace Game
public void SendLfgRoleChosen(ObjectGuid guid, LfgRoles roles)
{
RoleChosen roleChosen = new RoleChosen();
RoleChosen roleChosen = new();
roleChosen.Player = guid;
roleChosen.RoleMask = roles;
roleChosen.Accepted = roles > 0;
@@ -302,7 +302,7 @@ namespace Game
public void SendLfgRoleCheckUpdate(LfgRoleCheck roleCheck)
{
List<uint> dungeons = new List<uint>();
List<uint> dungeons = new();
if (roleCheck.rDungeonId != 0)
dungeons.Add(roleCheck.rDungeonId);
else
@@ -310,7 +310,7 @@ namespace Game
Log.outDebug(LogFilter.Lfg, "SMSG_LFG_ROLE_CHECK_UPDATE {0}", GetPlayerInfo());
LFGRoleCheckUpdate lfgRoleCheckUpdate = new LFGRoleCheckUpdate();
LFGRoleCheckUpdate lfgRoleCheckUpdate = new();
lfgRoleCheckUpdate.PartyIndex = 127;
lfgRoleCheckUpdate.RoleCheckStatus = (byte)roleCheck.state;
lfgRoleCheckUpdate.IsBeginning = roleCheck.state == LfgRoleCheckState.Initialiting;
@@ -340,7 +340,7 @@ namespace Game
public void SendLfgJoinResult(LfgJoinResultData joinData)
{
LFGJoinResult lfgJoinResult = new LFGJoinResult();
LFGJoinResult lfgJoinResult = new();
RideTicket ticket = Global.LFGMgr.GetTicket(GetPlayer().GetGUID());
if (ticket != null)
@@ -378,7 +378,7 @@ namespace Game
GetPlayerInfo(), Global.LFGMgr.GetState(GetPlayer().GetGUID()), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps);
LFGQueueStatus lfgQueueStatus = new LFGQueueStatus();
LFGQueueStatus lfgQueueStatus = new();
RideTicket ticket = Global.LFGMgr.GetTicket(GetPlayer().GetGUID());
if (ticket != null)
@@ -405,7 +405,7 @@ namespace Game
Log.outDebug(LogFilter.Lfg, "SMSG_LFG_PLAYER_REWARD {0} rdungeonEntry: {1}, sdungeonEntry: {2}, done: {3}",
GetPlayerInfo(), rewardData.rdungeonEntry, rewardData.sdungeonEntry, rewardData.done);
LFGPlayerReward lfgPlayerReward = new LFGPlayerReward();
LFGPlayerReward lfgPlayerReward = new();
lfgPlayerReward.QueuedSlot = rewardData.rdungeonEntry;
lfgPlayerReward.ActualSlot = rewardData.sdungeonEntry;
lfgPlayerReward.RewardMoney = GetPlayer().GetQuestMoneyReward(rewardData.quest);
@@ -446,7 +446,7 @@ namespace Game
Log.outDebug(LogFilter.Lfg, "SMSG_LFG_BOOT_PROPOSAL_UPDATE {0} inProgress: {1} - didVote: {2} - agree: {3} - victim: {4} votes: {5} - agrees: {6} - left: {7} - needed: {8} - reason {9}",
GetPlayerInfo(), boot.inProgress, playerVote != LfgAnswer.Pending, playerVote == LfgAnswer.Agree, boot.victim.ToString(), votesNum, agreeNum, secsleft, SharedConst.LFGKickVotesNeeded, boot.reason);
LfgBootPlayer lfgBootPlayer = new LfgBootPlayer();
LfgBootPlayer lfgBootPlayer = new();
lfgBootPlayer.Info.VoteInProgress = boot.inProgress; // Vote in progress
lfgBootPlayer.Info.VotePassed = agreeNum >= SharedConst.LFGKickVotesNeeded; // Did succeed
lfgBootPlayer.Info.MyVoteCompleted = playerVote != LfgAnswer.Pending; // Did Vote
@@ -477,7 +477,7 @@ namespace Game
dungeonEntry = playerDungeons.First();
}
LFGProposalUpdate lfgProposalUpdate = new LFGProposalUpdate();
LFGProposalUpdate lfgProposalUpdate = new();
RideTicket ticket = Global.LFGMgr.GetTicket(GetPlayer().GetGUID());
if (ticket != null)
+1 -1
View File
@@ -44,7 +44,7 @@ namespace Game
else if (pl.duel != null || pl.HasAura(9454)) // is dueling or frozen by GM via freeze command
reason = 2; // FIXME - Need the correct value
LogoutResponse logoutResponse = new LogoutResponse();
LogoutResponse logoutResponse = new();
logoutResponse.LogoutResult = reason;
logoutResponse.Instant = instantLogout;
SendPacket(logoutResponse);
+8 -8
View File
@@ -184,7 +184,7 @@ namespace Game
Group group = player.GetGroup();
List<Player> playersNear = new List<Player>();
List<Player> playersNear = new();
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
{
Player member = refe.GetSource();
@@ -204,7 +204,7 @@ namespace Game
pl.ModifyMoney((long)(goldPerPlayer + goldMod));
pl.UpdateCriteria(CriteriaTypes.LootMoney, goldPerPlayer);
LootMoneyNotify packet = new LootMoneyNotify();
LootMoneyNotify packet = new();
packet.Money = goldPerPlayer;
packet.MoneyMod = goldMod;
packet.SoleLooter = playersNear.Count <= 1 ? true : false;
@@ -218,7 +218,7 @@ namespace Game
player.ModifyMoney((long)(loot.gold + goldMod));
player.UpdateCriteria(CriteriaTypes.LootMoney, loot.gold);
LootMoneyNotify packet = new LootMoneyNotify();
LootMoneyNotify packet = new();
packet.Money = loot.gold;
packet.MoneyMod = goldMod;
packet.SoleLooter = true; // "You loot..."
@@ -272,9 +272,9 @@ namespace Game
if (!GetPlayer().IsAlive() || !packet.Unit.IsCreatureOrVehicle())
return;
List<Creature> corpses = new List<Creature>();
AELootCreatureCheck check = new AELootCreatureCheck(_player, packet.Unit);
CreatureListSearcher searcher = new CreatureListSearcher(_player, corpses, check);
List<Creature> corpses = new();
AELootCreatureCheck check = new(_player, packet.Unit);
CreatureListSearcher searcher = new(_player, corpses, check);
Cell.VisitGridObjects(_player, searcher, AELootCreatureCheck.LootDistance);
if (!corpses.Empty())
@@ -459,7 +459,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.MasterLootItem)]
void HandleLootMasterGive(MasterLootItem masterLootItem)
{
AELootResult aeResult = new AELootResult();
AELootResult aeResult = new();
if (GetPlayer().GetGroup() == null || GetPlayer().GetGroup().GetLooterGuid() != GetPlayer().GetGUID() || GetPlayer().GetGroup().GetLootMethod() != LootMethod.MasterLoot)
{
@@ -516,7 +516,7 @@ namespace Game
LootItem item = slotid >= loot.items.Count ? loot.quest_items[slotid - loot.items.Count] : loot.items[slotid];
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = target.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item.itemid, item.count);
if (item.follow_loot_rules && !item.AllowedForPlayer(target))
msg = InventoryResult.CantEquipEver;
+14 -14
View File
@@ -209,7 +209,7 @@ namespace Game
return;
}
List<Item> items = new List<Item>();
List<Item> items = new();
foreach (var att in packet.Info.Attachments)
{
if (att.ItemGUID.IsEmpty())
@@ -270,9 +270,9 @@ namespace Game
bool needItemDelay = false;
MailDraft draft = new MailDraft(packet.Info.Subject, packet.Info.Body);
MailDraft draft = new(packet.Info.Subject, packet.Info.Body);
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
if (!packet.Info.Attachments.Empty() || packet.Info.SendMoney > 0)
{
@@ -384,7 +384,7 @@ namespace Game
return;
}
//we can return mail now, so firstly delete the old one
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_MAIL_BY_ID);
stmt.AddValue(0, packet.MailID);
@@ -399,7 +399,7 @@ namespace Game
// only return mail if the player exists (and delete if not existing)
if (m.messageType == MailMessageType.Normal && m.sender != 0)
{
MailDraft draft = new MailDraft(m.subject, m.body);
MailDraft draft = new(m.subject, m.body);
if (m.mailTemplateId != 0)
draft = new MailDraft(m.mailTemplateId, false); // items already included
@@ -455,11 +455,11 @@ namespace Game
Item it = player.GetMItem(packet.AttachID);
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, dest, it, false);
if (msg == InventoryResult.Ok)
{
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
m.RemoveItem(packet.AttachID);
m.removedItems.Add(packet.AttachID);
@@ -550,7 +550,7 @@ namespace Game
player.SendMailResult(packet.MailID, MailResponseType.MoneyTaken, MailResponseResult.Ok);
// save money and mail to prevent cheating
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
player.SaveGoldToDB(trans);
player._SaveMail(trans);
DB.Characters.CommitTransaction(trans);
@@ -571,7 +571,7 @@ namespace Game
var mails = player.GetMails();
MailListResult response = new MailListResult();
MailListResult response = new();
long curTime = Time.UnixTime;
foreach (Mail m in mails)
@@ -609,7 +609,7 @@ namespace Game
return;
}
Item bodyItem = new Item(); // This is not bag and then can be used new Item.
Item bodyItem = new(); // This is not bag and then can be used new Item.
if (!bodyItem.Create(Global.ObjectMgr.GetGenerator(HighGuid.Item).Generate(), 8383, ItemContext.None, player))
return;
@@ -635,7 +635,7 @@ namespace Game
Log.outInfo(LogFilter.Network, "HandleMailCreateTextItem mailid={0}", packet.MailID);
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, dest, bodyItem, false);
if (msg == InventoryResult.Ok)
{
@@ -653,7 +653,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryNextMailTime)]
void HandleQueryNextMailTime(MailQueryNextMailTime packet)
{
MailQueryNextTimeResult result = new MailQueryNextTimeResult();
MailQueryNextTimeResult result = new();
if (!GetPlayer().m_mailsLoaded)
GetPlayer()._LoadMail();
@@ -663,7 +663,7 @@ namespace Game
result.NextMailTime = 0.0f;
long now = Time.UnixTime;
List<ulong> sentSenders = new List<ulong>();
List<ulong> sentSenders = new();
foreach (Mail mail in GetPlayer().GetMails())
{
@@ -695,7 +695,7 @@ namespace Game
public void SendShowMailBox(ObjectGuid guid)
{
ShowMailbox packet = new ShowMailbox();
ShowMailbox packet = new();
packet.PostmasterGUID = guid;
SendPacket(packet);
}
+4 -4
View File
@@ -43,7 +43,7 @@ namespace Game
AccountData adata = GetAccountData(request.DataType);
UpdateAccountData data = new UpdateAccountData();
UpdateAccountData data = new();
data.Player = GetPlayer() ? GetPlayer().GetGUID() : ObjectGuid.Empty;
data.Time = (uint)adata.Time;
data.DataType = request.DataType;
@@ -369,7 +369,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestPlayedTime)]
void HandlePlayedTime(RequestPlayedTime packet)
{
PlayedTime playedTime = new PlayedTime();
PlayedTime playedTime = new();
playedTime.TotalTime = GetPlayer().GetTotalPlayedTime();
playedTime.LevelTime = GetPlayer().GetLevelPlayedTime();
playedTime.TriggerEvent = packet.TriggerScriptEvent; // 0-1 - will not show in chat frame
@@ -396,7 +396,7 @@ namespace Game
{
Player player = GetPlayer();
LoadCUFProfiles loadCUFProfiles = new LoadCUFProfiles();
LoadCUFProfiles loadCUFProfiles = new();
for (byte i = 0; i < PlayerConst.MaxCUFProfiles; ++i)
{
@@ -417,7 +417,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.MountSpecialAnim)]
void HandleMountSpecialAnim(MountSpecial mountSpecial)
{
SpecialMountAnim specialMountAnim = new SpecialMountAnim();
SpecialMountAnim specialMountAnim = new();
specialMountAnim.UnitGUID = _player.GetGUID();
GetPlayer().SendMessageToSet(specialMountAnim, false);
}
+8 -8
View File
@@ -171,7 +171,7 @@ namespace Game
mover.UpdatePosition(movementInfo.Pos);
MoveUpdate moveUpdate = new MoveUpdate();
MoveUpdate moveUpdate = new();
moveUpdate.Status = mover.m_movementInfo;
mover.SendMessageToSet(moveUpdate, GetPlayer());
@@ -274,7 +274,7 @@ namespace Game
GetPlayer().ResetMap();
GetPlayer().SetMap(newMap);
ResumeToken resumeToken = new ResumeToken();
ResumeToken resumeToken = new();
resumeToken.SequenceIndex = _player.m_movementCounter;
resumeToken.Reason = seamlessTeleport ? 2 : 1u;
SendPacket(resumeToken);
@@ -416,12 +416,12 @@ namespace Game
if (CliDB.MapStorage.LookupByKey(loc.GetMapId()).IsDungeon())
{
UpdateLastInstance updateLastInstance = new UpdateLastInstance();
UpdateLastInstance updateLastInstance = new();
updateLastInstance.MapID = loc.GetMapId();
SendPacket(updateLastInstance);
}
NewWorld packet = new NewWorld();
NewWorld packet = new();
packet.MapID = loc.GetMapId();
packet.Loc.Pos = loc;
packet.Reason = (uint)(!_player.IsBeingTeleportedSeamlessly() ? NewWorldReason.Normal : NewWorldReason.Seamless);
@@ -577,7 +577,7 @@ namespace Game
GetPlayer().m_movementInfo = movementAck.Ack.Status;
MoveUpdateKnockBack updateKnockBack = new MoveUpdateKnockBack();
MoveUpdateKnockBack updateKnockBack = new();
updateKnockBack.Status = GetPlayer().m_movementInfo;
GetPlayer().SendMessageToSet(updateKnockBack, false);
}
@@ -630,7 +630,7 @@ namespace Game
moveApplyMovementForceAck.Ack.Status.Time += m_clientTimeDelay;
MoveUpdateApplyMovementForce updateApplyMovementForce = new MoveUpdateApplyMovementForce();
MoveUpdateApplyMovementForce updateApplyMovementForce = new();
updateApplyMovementForce.Status = moveApplyMovementForceAck.Ack.Status;
updateApplyMovementForce.Force = moveApplyMovementForceAck.Force;
mover.SendMessageToSet(updateApplyMovementForce, false);
@@ -652,7 +652,7 @@ namespace Game
moveRemoveMovementForceAck.Ack.Status.Time += m_clientTimeDelay;
MoveUpdateRemoveMovementForce updateRemoveMovementForce = new MoveUpdateRemoveMovementForce();
MoveUpdateRemoveMovementForce updateRemoveMovementForce = new();
updateRemoveMovementForce.Status = moveRemoveMovementForceAck.Ack.Status;
updateRemoveMovementForce.TriggerGUID = moveRemoveMovementForceAck.ID;
mover.SendMessageToSet(updateRemoveMovementForce, false);
@@ -694,7 +694,7 @@ namespace Game
setModMovementForceMagnitudeAck.Ack.Status.Time += m_clientTimeDelay;
MoveUpdateSpeed updateModMovementForceMagnitude = new MoveUpdateSpeed(ServerOpcodes.MoveUpdateModMovementForceMagnitude);
MoveUpdateSpeed updateModMovementForceMagnitude = new(ServerOpcodes.MoveUpdateModMovementForceMagnitude);
updateModMovementForceMagnitude.Status = setModMovementForceMagnitudeAck.Ack.Status;
updateModMovementForceMagnitude.Speed = setModMovementForceMagnitudeAck.Speed;
mover.SendMessageToSet(updateModMovementForceMagnitude, false);
+6 -6
View File
@@ -48,7 +48,7 @@ namespace Game
public void SendTabardVendorActivate(ObjectGuid guid)
{
PlayerTabardVendorActivate packet = new PlayerTabardVendorActivate();
PlayerTabardVendorActivate packet = new();
packet.Vendor = guid;
SendPacket(packet);
}
@@ -119,7 +119,7 @@ namespace Game
void SendTrainerBuyFailed(ObjectGuid trainerGUID, uint spellID, TrainerFailReason trainerFailedReason)
{
TrainerBuyFailed trainerBuyFailed = new TrainerBuyFailed();
TrainerBuyFailed trainerBuyFailed = new();
trainerBuyFailed.TrainerGUID = trainerGUID;
trainerBuyFailed.SpellID = spellID; // should be same as in packet from client
trainerBuyFailed.TrainerFailedReason = trainerFailedReason; // 1 == "Not enough money for trainer service." 0 == "Trainer service %d unavailable."
@@ -356,7 +356,7 @@ namespace Game
if (!GetPlayer())
return;
PetStableList packet = new PetStableList();
PetStableList packet = new();
packet.StableMaster = guid;
Pet pet = GetPlayer().GetPet();
@@ -403,7 +403,7 @@ namespace Game
void SendPetStableResult(StableResult result)
{
PetStableResult petStableResult = new PetStableResult();
PetStableResult petStableResult = new();
petStableResult.Result = result;
SendPacket(petStableResult);
}
@@ -470,7 +470,7 @@ namespace Game
VendorItemData vendorItems = vendor.GetVendorItems();
int rawItemCount = vendorItems != null ? vendorItems.GetItemCount() : 0;
VendorInventory packet = new VendorInventory();
VendorInventory packet = new();
packet.Vendor = vendor.GetGUID();
float discountMod = GetPlayer().GetReputationPriceDiscount(vendor);
@@ -481,7 +481,7 @@ namespace Game
if (vendorItem == null)
continue;
VendorItemPkt item = new VendorItemPkt();
VendorItemPkt item = new();
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(vendorItem.PlayerConditionId);
if (playerCondition != null)
+8 -8
View File
@@ -92,7 +92,7 @@ namespace Game
else
{
//If a pet is dismissed, m_Controlled will change
List<Unit> controlled = new List<Unit>();
List<Unit> controlled = new();
foreach (var unit in GetPlayer().m_Controlled)
if (unit.GetEntry() == pet.GetEntry() && unit.IsAlive())
controlled.Add(unit);
@@ -317,7 +317,7 @@ namespace Game
pet.GetCharmInfo().SetIsFollowing(false);
}
Spell spell = new Spell(pet, spellInfo, TriggerCastFlags.None);
Spell spell = new(pet, spellInfo, TriggerCastFlags.None);
SpellCastResult result = spell.CheckPetCast(unit_target);
@@ -418,7 +418,7 @@ namespace Game
void SendQueryPetNameResponse(ObjectGuid guid)
{
QueryPetNameResponse response = new QueryPetNameResponse();
QueryPetNameResponse response = new();
response.UnitGUID = guid;
Creature unit = ObjectAccessor.GetCreatureOrPetOrVehicle(GetPlayer(), guid);
@@ -560,7 +560,7 @@ namespace Game
pet.RemovePetFlag(UnitPetFlags.CanBeRenamed);
PreparedStatement stmt;
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
if (isdeclined)
{
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_PET_DECLINEDNAME);
@@ -673,10 +673,10 @@ namespace Game
if (!caster.HasSpell(spellInfo.Id) || spellInfo.IsPassive())
return;
SpellCastTargets targets = new SpellCastTargets(caster, petCastSpell.Cast);
SpellCastTargets targets = new(caster, petCastSpell.Cast);
caster.ClearUnitState(UnitState.Follow);
Spell spell = new Spell(caster, spellInfo, TriggerCastFlags.None);
Spell spell = new(caster, spellInfo, TriggerCastFlags.None);
spell.m_fromClient = true;
spell.m_misc.Data0 = petCastSpell.Cast.Misc[0];
spell.m_misc.Data1 = petCastSpell.Cast.Misc[1];
@@ -701,7 +701,7 @@ namespace Game
}
}
SpellPrepare spellPrepare = new SpellPrepare();
SpellPrepare spellPrepare = new();
spellPrepare.ClientCastID = petCastSpell.Cast.CastID;
spellPrepare.ServerCastID = spell.m_castId;
SendPacket(spellPrepare);
@@ -722,7 +722,7 @@ namespace Game
void SendPetNameInvalid(PetNameInvalidReason error, string name, DeclinedName declinedName)
{
PetNameInvalid petNameInvalid = new PetNameInvalid();
PetNameInvalid petNameInvalid = new();
petNameInvalid.Result = error;
petNameInvalid.RenameData.NewName = name;
for (int i = 0; i < SharedConst.MaxDeclinedNameCases; i++)
+12 -12
View File
@@ -75,7 +75,7 @@ namespace Game
return;
}
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = GetPlayer().CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, charterItemID, pProto.GetBuyCount());
if (msg != InventoryResult.Ok)
{
@@ -126,7 +126,7 @@ namespace Game
void SendPetitionSigns(Petition petition, Player sendTo)
{
ServerPetitionShowSignatures signaturesPacket = new ServerPetitionShowSignatures();
ServerPetitionShowSignatures signaturesPacket = new();
signaturesPacket.Item = petition.PetitionGuid;
signaturesPacket.Owner = petition.ownerGuid;
signaturesPacket.OwnerAccountID = ObjectGuid.Create(HighGuid.WowAccount, Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(petition.ownerGuid));
@@ -134,7 +134,7 @@ namespace Game
foreach (var signature in petition.signatures)
{
ServerPetitionShowSignatures.PetitionSignature signaturePkt = new ServerPetitionShowSignatures.PetitionSignature();
ServerPetitionShowSignatures.PetitionSignature signaturePkt = new();
signaturePkt.Signer = signature.PlayerGuid;
signaturePkt.Choice = 0;
signaturesPacket.Signatures.Add(signaturePkt);
@@ -151,7 +151,7 @@ namespace Game
public void SendPetitionQuery(ObjectGuid petitionGuid)
{
QueryPetitionResponse responsePacket = new QueryPetitionResponse();
QueryPetitionResponse responsePacket = new();
responsePacket.PetitionID = (uint)petitionGuid.GetCounter(); // PetitionID (in Trinity always same as GUID_LOPART(petition guid))
Petition petition = Global.PetitionMgr.GetPetition(petitionGuid);
@@ -165,7 +165,7 @@ namespace Game
uint reqSignatures = WorldConfig.GetUIntValue(WorldCfg.MinPetitionSigns);
PetitionInfo petitionInfo = new PetitionInfo();
PetitionInfo petitionInfo = new();
petitionInfo.PetitionID = (int)petitionGuid.GetCounter();
petitionInfo.Petitioner = petition.ownerGuid;
petitionInfo.MinSignatures = reqSignatures;
@@ -206,7 +206,7 @@ namespace Game
// update petition storage
petition.UpdateName(packet.NewGuildName);
PetitionRenameGuildResponse renameResponse = new PetitionRenameGuildResponse();
PetitionRenameGuildResponse renameResponse = new();
renameResponse.PetitionGuid = packet.PetitionGuid;
renameResponse.NewGuildName = packet.NewGuildName;
SendPacket(renameResponse);
@@ -252,7 +252,7 @@ namespace Game
// Client doesn't allow to sign petition two times by one character, but not check sign by another character from same account
// not allow sign another player from already sign player account
PetitionSignResults signResult = new PetitionSignResults();
PetitionSignResults signResult = new();
signResult.Player = GetPlayer().GetGUID();
signResult.Item = packet.PetitionGUID;
@@ -366,7 +366,7 @@ namespace Game
if (GetPlayer().GetGUID() != petition.ownerGuid)
return;
TurnInPetitionResult resultPacket = new TurnInPetitionResult();
TurnInPetitionResult resultPacket = new();
// Check if player is already in a guild
if (GetPlayer().GetGuildId() != 0)
@@ -399,7 +399,7 @@ namespace Game
GetPlayer().DestroyItem(item.GetBagSlot(), item.GetSlot(), true);
// Create guild
Guild guild = new Guild();
Guild guild = new();
if (!guild.Create(GetPlayer(), name))
return;
@@ -408,7 +408,7 @@ namespace Game
Guild.SendCommandResult(this, GuildCommandType.CreateGuild, GuildCommandError.Success, name);
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
// Add members from signatures
foreach (var signature in signatures)
@@ -440,10 +440,10 @@ namespace Game
return;
}
WorldPacket data = new WorldPacket(ServerOpcodes.PetitionShowList);
WorldPacket data = new(ServerOpcodes.PetitionShowList);
data.WritePackedGuid(guid); // npc guid
ServerPetitionShowList packet = new ServerPetitionShowList();
ServerPetitionShowList packet = new();
packet.Unit = guid;
packet.Price = WorldConfig.GetUIntValue(WorldCfg.CharterCostGuild);
SendPacket(packet);
+15 -15
View File
@@ -40,7 +40,7 @@ namespace Game
{
Player player = Global.ObjAccessor.FindPlayer(guid);
QueryPlayerNameResponse response = new QueryPlayerNameResponse();
QueryPlayerNameResponse response = new();
response.Player = guid;
if (response.Data.Initialize(guid, player))
@@ -59,7 +59,7 @@ namespace Game
void SendQueryTimeResponse()
{
QueryTimeResponse queryTimeResponse = new QueryTimeResponse();
QueryTimeResponse queryTimeResponse = new();
queryTimeResponse.CurrentTime = Time.UnixTime;
SendPacket(queryTimeResponse);
}
@@ -93,7 +93,7 @@ namespace Game
{
Log.outDebug(LogFilter.Network, $"WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (ENTRY: {packet.GameObjectID})");
QueryGameObjectResponse response = new QueryGameObjectResponse();
QueryGameObjectResponse response = new();
response.GameObjectID = packet.GameObjectID;
response.Guid = packet.Guid;
SendPacket(response);
@@ -136,7 +136,7 @@ namespace Game
{
Log.outDebug(LogFilter.Network, $"WORLD: CMSG_QUERY_CREATURE - NO CREATURE INFO! (ENTRY: {packet.CreatureID})");
QueryCreatureResponse response = new QueryCreatureResponse();
QueryCreatureResponse response = new();
response.CreatureID = packet.CreatureID;
SendPacket(response);
}
@@ -147,7 +147,7 @@ namespace Game
{
NpcText npcText = Global.ObjectMgr.GetNpcText(packet.TextID);
QueryNPCTextResponse response = new QueryNPCTextResponse();
QueryNPCTextResponse response = new();
response.TextID = packet.TextID;
if (npcText != null)
@@ -170,7 +170,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryPageText)]
void HandleQueryPageText(QueryPageText packet)
{
QueryPageTextResponse response = new QueryPageTextResponse();
QueryPageTextResponse response = new();
response.PageTextID = packet.PageTextID;
uint pageID = packet.PageTextID;
@@ -207,7 +207,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryCorpseLocationFromClient)]
void HandleQueryCorpseLocation(QueryCorpseLocationFromClient queryCorpseLocation)
{
CorpseLocation packet = new CorpseLocation();
CorpseLocation packet = new();
Player player = Global.ObjAccessor.FindConnectedPlayer(queryCorpseLocation.Player);
if (!player || !player.HasCorpse() || !_player.IsInSameRaidWith(player))
{
@@ -258,7 +258,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryCorpseTransport)]
void HandleQueryCorpseTransport(QueryCorpseTransport queryCorpseTransport)
{
CorpseTransportQuery response = new CorpseTransportQuery();
CorpseTransportQuery response = new();
response.Player = queryCorpseTransport.Player;
Player player = Global.ObjAccessor.FindConnectedPlayer(queryCorpseTransport.Player);
@@ -278,11 +278,11 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryQuestCompletionNpcs)]
void HandleQueryQuestCompletionNPCs(QueryQuestCompletionNPCs queryQuestCompletionNPCs)
{
QuestCompletionNPCResponse response = new QuestCompletionNPCResponse();
QuestCompletionNPCResponse response = new();
foreach (var questID in queryQuestCompletionNPCs.QuestCompletionNPCs)
{
QuestCompletionNPC questCompletionNPC = new QuestCompletionNPC();
QuestCompletionNPC questCompletionNPC = new();
if (Global.ObjectMgr.GetQuestTemplate(questID) == null)
{
@@ -313,11 +313,11 @@ namespace Game
return;
// Read quest ids and add the in a unordered_set so we don't send POIs for the same quest multiple times
HashSet<uint> questIds = new HashSet<uint>();
HashSet<uint> questIds = new();
for (int i = 0; i < packet.MissingQuestCount; ++i)
questIds.Add(packet.MissingQuestPOIs[i]); // QuestID
QuestPOIQueryResponse response = new QuestPOIQueryResponse();
QuestPOIQueryResponse response = new();
foreach (uint questId in questIds)
{
@@ -335,7 +335,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.ItemTextQuery)]
void HandleItemTextQuery(ItemTextQuery packet)
{
QueryItemTextResponse queryItemTextResponse = new QueryItemTextResponse();
QueryItemTextResponse queryItemTextResponse = new();
queryItemTextResponse.Id = packet.Id;
Item item = GetPlayer().GetItemByGuid(packet.Id);
@@ -351,10 +351,10 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryRealmName)]
void HandleQueryRealmName(QueryRealmName queryRealmName)
{
RealmQueryResponse realmQueryResponse = new RealmQueryResponse();
RealmQueryResponse realmQueryResponse = new();
realmQueryResponse.VirtualRealmAddress = queryRealmName.VirtualRealmAddress;
RealmId realmHandle = new RealmId(queryRealmName.VirtualRealmAddress);
RealmId realmHandle = new(queryRealmName.VirtualRealmAddress);
if (Global.ObjectMgr.GetRealmName(realmHandle.Index, ref realmQueryResponse.NameInfo.RealmNameActual, ref realmQueryResponse.NameInfo.RealmNameNormalized))
{
realmQueryResponse.LookupState = (byte)ResponseCodes.Success;
+3 -3
View File
@@ -229,7 +229,7 @@ namespace Game
_player.PlayerTalkClass.SendQuestQueryResponse(quest);
else
{
QueryQuestInfoResponse response = new QueryQuestInfoResponse();
QueryQuestInfoResponse response = new();
response.QuestID = packet.QuestID;
SendPacket(response);
}
@@ -689,7 +689,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestWorldQuestUpdate)]
void HandleRequestWorldQuestUpdate(RequestWorldQuestUpdate packet)
{
WorldQuestUpdateResponse response = new WorldQuestUpdateResponse();
WorldQuestUpdateResponse response = new();
// @todo: 7.x Has to be implemented
//response.WorldQuestUpdates.push_back(WorldPackets::Quest::WorldQuestUpdateInfo(lastUpdate, questID, timer, variableID, value));
@@ -742,7 +742,7 @@ namespace Game
foreach (PlayerChoiceResponseRewardItem item in reward.Items)
{
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
if (_player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, item.Id, (uint)item.Quantity) == InventoryResult.Ok)
{
Item newItem = _player.StoreNewItem(dest, item.Id, true, ItemEnchantmentManager.GenerateItemRandomBonusListId(item.Id), null, ItemContext.QuestReward, item.BonusListIDs);
+3 -3
View File
@@ -27,10 +27,10 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.QueryScenarioPoi)]
void HandleQueryScenarioPOI(QueryScenarioPOI queryScenarioPOI)
{
ScenarioPOIs response = new ScenarioPOIs();
ScenarioPOIs response = new();
// Read criteria tree ids and add the in a unordered_set so we don't send POIs for the same criteria tree multiple times
List<int> criteriaTreeIds = new List<int>();
List<int> criteriaTreeIds = new();
for (int i = 0; i < queryScenarioPOI.MissingScenarioPOIs.Count; ++i)
criteriaTreeIds.Add(queryScenarioPOI.MissingScenarioPOIs[i]); // CriteriaTreeID
@@ -39,7 +39,7 @@ namespace Game
var poiVector = Global.ScenarioMgr.GetScenarioPOIs((uint)criteriaTreeId);
if (poiVector != null)
{
ScenarioPOIData scenarioPOIData = new ScenarioPOIData();
ScenarioPOIData scenarioPOIData = new();
scenarioPOIData.CriteriaTreeID = criteriaTreeId;
scenarioPOIData.ScenarioPOIs = poiVector;
response.ScenarioPOIDataStats.Add(scenarioPOIData);
+2 -2
View File
@@ -29,7 +29,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.LearnTalents)]
void HandleLearnTalents(LearnTalents packet)
{
LearnTalentFailed learnTalentFailed = new LearnTalentFailed();
LearnTalentFailed learnTalentFailed = new();
bool anythingLearned = false;
foreach (uint talentId in packet.Talents)
{
@@ -55,7 +55,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.LearnPvpTalents)]
void HandleLearnPvpTalents(LearnPvpTalents packet)
{
LearnPvpTalentFailed learnPvpTalentFailed = new LearnPvpTalentFailed();
LearnPvpTalentFailed learnPvpTalentFailed = new();
bool anythingLearned = false;
foreach (var pvpTalent in packet.Talents)
{
+3 -3
View File
@@ -65,7 +65,7 @@ namespace Game
uint gmLevelInWhoList = WorldConfig.GetUIntValue(WorldCfg.GmLevelInWhoList);
WhoResponsePkt response = new WhoResponsePkt();
WhoResponsePkt response = new();
response.RequestID = whoRequest.RequestID;
List<WhoListPlayerInfo> whoList = Global.WhoListStorageMgr.GetWhoList();
@@ -137,7 +137,7 @@ namespace Game
continue;
}
WhoEntry whoEntry = new WhoEntry();
WhoEntry whoEntry = new();
if (!whoEntry.PlayerData.Initialize(target.Guid, null))
continue;
@@ -205,7 +205,7 @@ namespace Game
if (string.IsNullOrEmpty(lastip))
lastip = "Unknown";
WhoIsResponse response = new WhoIsResponse();
WhoIsResponse response = new();
response.AccountName = packet.CharName + "'s " + "account is " + acc + ", e-mail: " + email + ", last ip: " + lastip;
SendPacket(response);
}
+8 -8
View File
@@ -115,7 +115,7 @@ namespace Game
}
}
SpellCastTargets targets = new SpellCastTargets(user, packet.Cast);
SpellCastTargets targets = new(user, packet.Cast);
// Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state.
if (!Global.ScriptMgr.OnItemUse(user, item, targets, packet.Cast.CastID))
@@ -214,7 +214,7 @@ namespace Game
return;
}
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
uint entry = result.Read<uint>(0);
uint flags = result.Read<uint>(1);
@@ -313,7 +313,7 @@ namespace Game
return;
// client provided targets
SpellCastTargets targets = new SpellCastTargets(caster, cast.Cast);
SpellCastTargets targets = new(caster, cast.Cast);
// auto-selection buff level base at target level (in spellInfo)
if (targets.GetUnitTarget() != null)
@@ -328,9 +328,9 @@ namespace Game
if (cast.Cast.MoveUpdate.HasValue)
HandleMovementOpcode(ClientOpcodes.MoveStop, cast.Cast.MoveUpdate.Value);
Spell spell = new Spell(caster, spellInfo, TriggerCastFlags.None, ObjectGuid.Empty, false);
Spell spell = new(caster, spellInfo, TriggerCastFlags.None, ObjectGuid.Empty, false);
SpellPrepare spellPrepare = new SpellPrepare();
SpellPrepare spellPrepare = new();
spellPrepare.ClientCastID = cast.Cast.CastID;
spellPrepare.ServerCastID = spell.m_castId;
SendPacket(spellPrepare);
@@ -522,7 +522,7 @@ namespace Game
Player player = creator.ToPlayer();
if (player)
{
MirrorImageComponentedData mirrorImageComponentedData = new MirrorImageComponentedData();
MirrorImageComponentedData mirrorImageComponentedData = new();
mirrorImageComponentedData.UnitGUID = guid;
mirrorImageComponentedData.DisplayID = (int)creator.GetDisplayId();
mirrorImageComponentedData.RaceID = (byte)creator.GetRace();
@@ -572,7 +572,7 @@ namespace Game
}
else
{
MirrorImageCreatureData data = new MirrorImageCreatureData();
MirrorImageCreatureData data = new();
data.UnitGUID = guid;
data.DisplayID = (int)creator.GetDisplayId();
SendPacket(data);
@@ -597,7 +597,7 @@ namespace Game
// we changed dest, recalculate flight time
spell.RecalculateDelayMomentForDst();
NotifyMissileTrajectoryCollision data = new NotifyMissileTrajectoryCollision();
NotifyMissileTrajectoryCollision data = new();
data.Caster = packet.Target;
data.CastID = packet.CastID;
data.CollisionPos = packet.CollisionPos;
+5 -5
View File
@@ -56,7 +56,7 @@ namespace Game
// find taxi node
uint nearest = Global.ObjectMgr.GetNearestTaxiNode(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetMapId(), player.GetTeam());
TaxiNodeStatusPkt data = new TaxiNodeStatusPkt();
TaxiNodeStatusPkt data = new();
data.Unit = guid;
if (nearest == 0)
@@ -103,7 +103,7 @@ namespace Game
if (unit.GetEntry() == 29480)
GetPlayer().SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it.
ShowTaxiNodes data = new ShowTaxiNodes();
ShowTaxiNodes data = new();
data.WindowInfo.HasValue = true;
data.WindowInfo.Value.UnitGUID = unit.GetGUID();
data.WindowInfo.Value.CurrentNode = (int)curloc;
@@ -150,7 +150,7 @@ namespace Game
{
SendPacket(new NewTaxiPath());
TaxiNodeStatusPkt data = new TaxiNodeStatusPkt();
TaxiNodeStatusPkt data = new();
data.Unit = unit.GetGUID();
data.Status = TaxiNodeStatus.Learned;
SendPacket(data);
@@ -220,14 +220,14 @@ namespace Game
}
}
List<uint> nodes = new List<uint>();
List<uint> nodes = new();
Global.TaxiPathGraph.GetCompleteNodeRoute(from, to, GetPlayer(), nodes);
GetPlayer().ActivateTaxiPathTo(nodes, unit, 0, preferredMountDisplay);
}
public void SendActivateTaxiReply(ActivateTaxiReply reply = ActivateTaxiReply.Ok)
{
ActivateTaxiReplyPkt data = new ActivateTaxiReplyPkt();
ActivateTaxiReplyPkt data = new();
data.Reply = reply;
SendPacket(data);
}
+6 -6
View File
@@ -29,7 +29,7 @@ namespace Game
void HandleGMTicketGetCaseStatus(GMTicketGetCaseStatus packet)
{
//TODO: Implement GmCase and handle this packet correctly
GMTicketCaseStatus status = new GMTicketCaseStatus();
GMTicketCaseStatus status = new();
SendPacket(status);
}
@@ -38,7 +38,7 @@ namespace Game
{
// Note: This only disables the ticket UI at client side and is not fully reliable
// Note: This disables the whole customer support UI after trying to send a ticket in disabled state (MessageBox: "GM Help Tickets are currently unavaiable."). UI remains disabled until the character relogs.
GMTicketSystemStatusPkt response = new GMTicketSystemStatusPkt();
GMTicketSystemStatusPkt response = new();
response.Status = Global.SupportMgr.GetSupportSystemStatus() ? 1 : 0;
SendPacket(response);
}
@@ -51,7 +51,7 @@ namespace Game
if (!Global.SupportMgr.GetSuggestionSystemStatus())
return;
SuggestionTicket ticket = new SuggestionTicket(GetPlayer());
SuggestionTicket ticket = new(GetPlayer());
ticket.SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
ticket.SetFacing(userFeedback.Header.Facing);
ticket.SetNote(userFeedback.Note);
@@ -63,7 +63,7 @@ namespace Game
if (!Global.SupportMgr.GetBugSystemStatus())
return;
BugTicket ticket = new BugTicket(GetPlayer());
BugTicket ticket = new(GetPlayer());
ticket.SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
ticket.SetFacing(userFeedback.Header.Facing);
ticket.SetNote(userFeedback.Note);
@@ -78,7 +78,7 @@ namespace Game
if (!Global.SupportMgr.GetComplaintSystemStatus())
return;
ComplaintTicket comp = new ComplaintTicket(GetPlayer());
ComplaintTicket comp = new(GetPlayer());
comp.SetPosition(packet.Header.MapID, packet.Header.Position);
comp.SetFacing(packet.Header.Facing);
comp.SetChatLog(packet.ChatLog);
@@ -107,7 +107,7 @@ namespace Game
{ // NOTE: all chat messages from this spammer are automatically ignored by the spam reporter until logout in case of chat spam.
// if it's mail spam - ALL mails from this spammer are automatically removed by client
ComplaintResult result = new ComplaintResult();
ComplaintResult result = new();
result.ComplaintType = packet.ComplaintType;
result.Result = 0;
SendPacket(result);
+1 -1
View File
@@ -27,7 +27,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.ServerTimeOffsetRequest, Status = SessionStatus.Authed, Processing = PacketProcessing.Inplace)]
void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet)
{
ServerTimeOffset response = new ServerTimeOffset();
ServerTimeOffset response = new();
response.Time = (uint)Time.UnixTime;
SendPacket(response);
}
+2 -2
View File
@@ -26,7 +26,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.CommerceTokenGetLog)]
void HandleCommerceTokenGetLog(CommerceTokenGetLog commerceTokenGetLog)
{
CommerceTokenGetLogResponse response = new CommerceTokenGetLogResponse();
CommerceTokenGetLogResponse response = new();
// @todo: fix 6.x implementation
response.UnkInt = commerceTokenGetLog.UnkInt;
@@ -38,7 +38,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.CommerceTokenGetMarketPrice)]
void HandleCommerceTokenGetMarketPrice(CommerceTokenGetMarketPrice commerceTokenGetMarketPrice)
{
CommerceTokenGetMarketPriceResponse response = new CommerceTokenGetMarketPriceResponse();
CommerceTokenGetMarketPriceResponse response = new();
// @todo: 6.x fix implementation
response.CurrentMarketPrice = 300000000;
+3 -3
View File
@@ -77,11 +77,11 @@ namespace Game
if (_player.IsPossessing())
return;
SpellCastTargets targets = new SpellCastTargets(_player, packet.Cast);
SpellCastTargets targets = new(_player, packet.Cast);
Spell spell = new Spell(_player, spellInfo, TriggerCastFlags.None, ObjectGuid.Empty, false);
Spell spell = new(_player, spellInfo, TriggerCastFlags.None, ObjectGuid.Empty, false);
SpellPrepare spellPrepare = new SpellPrepare();
SpellPrepare spellPrepare = new();
spellPrepare.ClientCastID = packet.Cast.CastID;
spellPrepare.ServerCastID = spell.m_castId;
SendPacket(spellPrepare);
+15 -15
View File
@@ -45,7 +45,7 @@ namespace Game
{
TradeData view_trade = trader_data ? GetPlayer().GetTradeData().GetTraderData() : GetPlayer().GetTradeData();
TradeUpdated tradeUpdated = new TradeUpdated();
TradeUpdated tradeUpdated = new();
tradeUpdated.WhichPlayer = (byte)(trader_data ? 1 : 0);
tradeUpdated.ClientStateIndex = view_trade.GetClientStateIndex();
tradeUpdated.CurrentStateIndex = view_trade.GetServerStateIndex();
@@ -57,7 +57,7 @@ namespace Game
Item item = view_trade.GetItem((TradeSlots)i);
if (item)
{
TradeUpdated.TradeItem tradeItem = new TradeUpdated.TradeItem();
TradeUpdated.TradeItem tradeItem = new();
tradeItem.Slot = i;
tradeItem.Item = new ItemInstance(item);
tradeItem.StackCount = (int)item.GetCount();
@@ -79,7 +79,7 @@ namespace Game
{
if (gemData.ItemId != 0)
{
ItemGemData gem = new ItemGemData();
ItemGemData gem = new();
gem.Slot = g;
gem.Item = new ItemInstance(gemData);
tradeItem.Unwrapped.Value.Gems.Add(gem);
@@ -102,8 +102,8 @@ namespace Game
for (byte i = 0; i < (int)TradeSlots.TradedCount; ++i)
{
List<ItemPosCount> traderDst = new List<ItemPosCount>();
List<ItemPosCount> playerDst = new List<ItemPosCount>();
List<ItemPosCount> traderDst = new();
List<ItemPosCount> playerDst = new();
bool traderCanTrade = (myItems[i] == null || trader.CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, traderDst, myItems[i], false) == InventoryResult.Ok);
bool playerCanTrade = (hisItems[i] == null || GetPlayer().CanStoreItem(ItemConst.NullBag, ItemConst.NullSlot, playerDst, hisItems[i], false) == InventoryResult.Ok);
if (traderCanTrade && playerCanTrade)
@@ -239,7 +239,7 @@ namespace Game
// set before checks for propertly undo at problems (it already set in to client)
my_trade.SetAccepted(true);
TradeStatusPkt info = new TradeStatusPkt();
TradeStatusPkt info = new();
if (his_trade.GetServerStateIndex() != acceptTrade.StateIndex)
{
info.Status = TradeStatus.StateChanged;
@@ -332,10 +332,10 @@ namespace Game
SetAcceptTradeMode(my_trade, his_trade, myItems, hisItems);
Spell my_spell = null;
SpellCastTargets my_targets = new SpellCastTargets();
SpellCastTargets my_targets = new();
Spell his_spell = null;
SpellCastTargets his_targets = new SpellCastTargets();
SpellCastTargets his_targets = new();
// not accept if spell can't be casted now (cheating)
uint my_spell_id = my_trade.GetSpell();
@@ -415,8 +415,8 @@ namespace Game
trader.GetSession().SendTradeStatus(info);
// test if item will fit in each inventory
TradeStatusPkt myCanCompleteInfo = new TradeStatusPkt();
TradeStatusPkt hisCanCompleteInfo = new TradeStatusPkt();
TradeStatusPkt myCanCompleteInfo = new();
TradeStatusPkt hisCanCompleteInfo = new();
hisCanCompleteInfo.BagResult = trader.CanStoreItems(myItems, (int)TradeSlots.TradedCount, ref hisCanCompleteInfo.ItemID);
myCanCompleteInfo.BagResult = GetPlayer().CanStoreItems(hisItems, (int)TradeSlots.TradedCount, ref myCanCompleteInfo.ItemID);
@@ -501,7 +501,7 @@ namespace Game
trader.SetTradeData(null);
// desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards)
SQLTransaction trans = new SQLTransaction();
SQLTransaction trans = new();
GetPlayer().SaveInventoryAndGoldToDB(trans);
trader.SaveInventoryAndGoldToDB(trans);
DB.Characters.CommitTransaction(trans);
@@ -534,7 +534,7 @@ namespace Game
if (my_trade == null)
return;
TradeStatusPkt info = new TradeStatusPkt();
TradeStatusPkt info = new();
my_trade.GetTrader().GetSession().SendTradeStatus(info);
SendTradeStatus(info);
}
@@ -544,7 +544,7 @@ namespace Game
if (PlayerRecentlyLoggedOut() || PlayerLogout())
return;
TradeStatusPkt info = new TradeStatusPkt();
TradeStatusPkt info = new();
info.Status = TradeStatus.Cancelled;
SendTradeStatus(info);
}
@@ -563,7 +563,7 @@ namespace Game
if (GetPlayer().GetTradeData() != null)
return;
TradeStatusPkt info = new TradeStatusPkt();
TradeStatusPkt info = new();
if (!GetPlayer().IsAlive())
{
info.Status = TradeStatus.Dead;
@@ -700,7 +700,7 @@ namespace Game
if (my_trade == null)
return;
TradeStatusPkt info = new TradeStatusPkt();
TradeStatusPkt info = new();
// invalid slot number
if (setTradeItem.TradeSlot >= (byte)TradeSlots.Count)
{
@@ -40,12 +40,12 @@ namespace Game
}
long cost = 0;
Dictionary<Item, uint[]> transmogItems = new Dictionary<Item, uint[]>();// new Dictionary<Item, Tuple<uint, uint>>();
Dictionary<Item, uint> illusionItems = new Dictionary<Item, uint>();
Dictionary<Item, uint[]> transmogItems = new();// new Dictionary<Item, Tuple<uint, uint>>();
Dictionary<Item, uint> illusionItems = new();
List<Item> resetAppearanceItems = new List<Item>();
List<Item> resetIllusionItems = new List<Item>();
List<uint> bindAppearances = new List<uint>();
List<Item> resetAppearanceItems = new();
List<Item> resetIllusionItems = new();
List<uint> bindAppearances = new();
bool validateAndStoreTransmogItem(Item itemTransmogrified, uint itemModifiedAppearanceId, bool isSecondary)
{
+6 -6
View File
@@ -70,14 +70,14 @@ namespace Game
return;
}
VoidStorageContents voidStorageContents = new VoidStorageContents();
VoidStorageContents voidStorageContents = new();
for (byte i = 0; i < SharedConst.VoidStorageMaxSlot; ++i)
{
VoidStorageItem item = player.GetVoidStorageItem(i);
if (item == null)
continue;
VoidItem voidItem = new VoidItem();
VoidItem voidItem = new();
voidItem.Guid = ObjectGuid.Create(HighGuid.Item, item.ItemId);
voidItem.Creator = item.CreatorGuid;
voidItem.Slot = i;
@@ -143,7 +143,7 @@ namespace Game
return;
}
VoidStorageTransferChanges voidStorageTransferChanges = new VoidStorageTransferChanges();
VoidStorageTransferChanges voidStorageTransferChanges = new();
byte depositCount = 0;
for (int i = 0; i < voidStorageTransfer.Deposits.Length; ++i)
@@ -155,7 +155,7 @@ namespace Game
continue;
}
VoidStorageItem itemVS = new VoidStorageItem(Global.ObjectMgr.GenerateVoidStorageItemId(), item.GetEntry(), item.GetCreator(),
VoidStorageItem itemVS = new(Global.ObjectMgr.GenerateVoidStorageItemId(), item.GetEntry(), item.GetCreator(),
item.GetItemRandomBonusListId(), item.GetModifier(ItemModifier.TimewalkerLevel), item.GetModifier(ItemModifier.ArtifactKnowledgeLevel),
item.GetContext(), item.m_itemData.BonusListIDs);
@@ -185,7 +185,7 @@ namespace Game
continue;
}
List<ItemPosCount> dest = new List<ItemPosCount>();
List<ItemPosCount> dest = new();
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, itemVS.ItemEntry, 1);
if (msg != InventoryResult.Ok)
{
@@ -244,7 +244,7 @@ namespace Game
return;
}
VoidItemSwapResponse voidItemSwapResponse = new VoidItemSwapResponse();
VoidItemSwapResponse voidItemSwapResponse = new();
voidItemSwapResponse.VoidItemA = swapVoidItem.VoidItemGuid;
voidItemSwapResponse.VoidItemSlotA = swapVoidItem.DstSlot;
if (usedDestSlot)