Cleanup
This commit is contained in:
parent
8b126a9aa7
commit
31b1dc8ef1
@ -43,8 +43,8 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
{
|
{
|
||||||
game.SetAct(int.Parse(args[2].Trim()));
|
game.SetAct(int.Parse(args[2].Trim()));
|
||||||
game.SetGameMode((Game.Mode)int.Parse(args[7].Trim()));
|
game.SetGameMode((Game.Mode)int.Parse(args[7].Trim()));
|
||||||
game.IsHardcore = (args[6].Trim() == "True" ? true : false);
|
game.IsHardcore = args[6].Trim() == "True" ? true : false;
|
||||||
game.IsSeasoned = (args[8].Trim() == "True" ? true : false);
|
game.IsSeasoned = args[8].Trim() == "True" ? true : false;
|
||||||
game.SetDifficulty(int.Parse(args[3].Trim()));
|
game.SetDifficulty(int.Parse(args[3].Trim()));
|
||||||
if (game.GameMode != Game.Mode.Portals)
|
if (game.GameMode != Game.Mode.Portals)
|
||||||
game.SetQuestProgress(int.Parse(args[4].Trim()), int.Parse(args[5].Trim()));
|
game.SetQuestProgress(int.Parse(args[4].Trim()), int.Parse(args[5].Trim()));
|
||||||
@ -92,140 +92,138 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BattleNetSocketSend(string data) => BattleNetSocketSend(Encoding.UTF8.GetBytes(data));
|
private void BattleNetSocketSend(string data) => BattleNetSocketSend(data);
|
||||||
|
|
||||||
private bool SenderServerDisconnected()
|
private bool SenderServerDisconnected()
|
||||||
{
|
{
|
||||||
Logger.Warn("MooNetServer was disconnected!");
|
Logger.Warn("Blizznet was disconnected!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterGameServer(string ip, int port)
|
public void RegisterGameServer(string ip, int port)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"ip {ip}, port {port}");
|
Logger.MethodTrace($"ip {ip}, port {port}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"rngsr|{ip}/{port}"));
|
BattleNetSocketSend($"rngsr|{ip}/{port}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterPvPGameServer(string ip, int port)
|
public void RegisterPvPGameServer(string ip, int port)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"ip {ip}, port {port}");
|
Logger.MethodTrace($"ip {ip}, port {port}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"rnpvpgsr|{ip}/{port}"));
|
BattleNetSocketSend($"rnpvpgsr|{ip}/{port}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GrantAchievement(ulong gameAccountId, ulong achievementId)
|
public void GrantAchievement(ulong gameAccountId, ulong achievementId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, achievementId {achievementId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, achievementId {achievementId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"grachi|{gameAccountId}/{achievementId}"));
|
BattleNetSocketSend($"grachi|{gameAccountId}/{achievementId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GrantCriteria(ulong gameAccountId, ulong criteriaId)
|
public void GrantCriteria(ulong gameAccountId, ulong criteriaId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, achievementId {criteriaId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, achievementId {criteriaId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"gcrit|{gameAccountId}/{criteriaId}"));
|
BattleNetSocketSend($"gcrit|{gameAccountId}/{criteriaId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateAchievementCounter(ulong gameAccountId, int type, uint addCounter, int comparand, ulong achievement = 0)
|
public void UpdateAchievementCounter(ulong gameAccountId, int type, uint addCounter, int comparand, ulong achievement = 0)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"type {type}, addCounter {addCounter}, comparand {comparand}");
|
Logger.MethodTrace($"type {type}, addCounter {addCounter}, comparand {comparand}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes(
|
BattleNetSocketSend($"uoacce|{gameAccountId}/{type}/{addCounter}/{comparand}/{achievement}");
|
||||||
$"uoacce|{gameAccountId}/{type}/{addCounter}/{comparand}/{achievement}"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSingleAchievementCounter(ulong gameAccountId, ulong achId, uint addCounter)
|
public void UpdateSingleAchievementCounter(ulong gameAccountId, ulong achId, uint addCounter)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"type {achId}, addCounter {addCounter}");
|
Logger.MethodTrace($"type {achId}, addCounter {addCounter}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"upsnaccr|{gameAccountId}/{achId}/{addCounter}"));
|
BattleNetSocketSend($"upsnaccr|{gameAccountId}/{achId}/{addCounter}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateQuantity(ulong gameAccountId, ulong achievementId, uint addCounter)
|
public void UpdateQuantity(ulong gameAccountId, ulong achievementId, uint addCounter)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"achievementId {achievementId}, addCounter {addCounter}");
|
Logger.MethodTrace($"achievementId {achievementId}, addCounter {addCounter}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"upequt|{gameAccountId}/{achievementId}/{addCounter}"));
|
BattleNetSocketSend($"upequt|{gameAccountId}/{achievementId}/{addCounter}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckQuestCriteria(ulong gameAccountId, int questId, bool isCoop)
|
public void CheckQuestCriteria(ulong gameAccountId, int questId, bool isCoop)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, questId {questId}, coop {isCoop}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, questId {questId}, coop {isCoop}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"cqc|{gameAccountId}/{questId}/{(isCoop ? "True" : "False")}"));
|
BattleNetSocketSend($"cqc|{gameAccountId}/{questId}/{(isCoop ? "True" : "False")}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckKillMonsterCriteria(ulong gameAccountId, int actorId, int type, bool isHardcore)
|
public void CheckKillMonsterCriteria(ulong gameAccountId, int actorId, int type, bool isHardcore)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, actorId {actorId}, type {type}, hc {isHardcore}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, actorId {actorId}, type {type}, hc {isHardcore}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes(
|
BattleNetSocketSend($"ckmc|{gameAccountId}/{actorId}/{type}/{(isHardcore ? "True" : "False")}";
|
||||||
$"ckmc|{gameAccountId}/{actorId}/{type}/{(isHardcore ? "True" : "False")}"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckSalvageItemCriteria(ulong gameAccountId, int itemId)
|
public void CheckSalvageItemCriteria(ulong gameAccountId, int itemId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, itemId {itemId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, itemId {itemId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"csic|{gameAccountId}/{itemId}"));
|
BattleNetSocketSend($"csic|{gameAccountId}/{itemId}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckLevelCap(ulong gameAccountId)
|
public void CheckLevelCap(ulong gameAccountId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"clc|{gameAccountId}"));
|
BattleNetSocketSend($"clc|{gameAccountId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckConversationCriteria(ulong gameAccountId, int convId)
|
public void CheckConversationCriteria(ulong gameAccountId, int convId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, convId {convId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, convId {convId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"ccc|{gameAccountId}/{convId}"));
|
BattleNetSocketSend($"ccc|{gameAccountId}/{convId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckLevelAreaCriteria(ulong gameAccountId, int laId)
|
public void CheckLevelAreaCriteria(ulong gameAccountId, int laId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, laId {laId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, laId {laId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"clac|{gameAccountId}/{laId}"));
|
BattleNetSocketSend($"clac|{gameAccountId}/{laId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateClient(ulong gameAccountId, int level, int screen)
|
public void UpdateClient(ulong gameAccountId, int level, int screen)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"uc|{gameAccountId}/{level}/{screen}"));
|
BattleNetSocketSend($"uc|{gameAccountId}/{level}/{screen}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayerJoined(int gameId)
|
public void PlayerJoined(int gameId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameId {gameId}");
|
Logger.MethodTrace($"gameId {gameId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"gpj|{gameId}"));
|
BattleNetSocketSend($"gpj|{gameId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayerLeft(int gameId)
|
public void PlayerLeft(int gameId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameId {gameId}");
|
Logger.MethodTrace($"gameId {gameId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"gpl|{gameId}"));
|
BattleNetSocketSend($"gpl|{gameId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetGamePublic(int gameId)
|
public void SetGamePublic(int gameId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameId {gameId}");
|
Logger.MethodTrace($"gameId {gameId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"gsp|{gameId}"));
|
BattleNetSocketSend($"gsp|{gameId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PvPSaveProgress(ulong gameAccountId, int kills, int wins, int gold)
|
public void PvPSaveProgress(ulong gameAccountId, int kills, int wins, int gold)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"game account id {gameAccountId}");
|
Logger.MethodTrace($"game account id {gameAccountId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"pvpsp|{gameAccountId}/{kills}/{wins}/{gold}"));
|
BattleNetSocketSend($"pvpsp|{gameAccountId}/{kills}/{wins}/{gold}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ParagonLevelUp(ulong gameAccountId)
|
public void ParagonLevelUp(ulong gameAccountId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"game account id {gameAccountId}");
|
Logger.MethodTrace($"game account id {gameAccountId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"plu|{gameAccountId}"));
|
BattleNetSocketSend($"plu|{gameAccountId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToonStateChanged(ulong toonId)
|
public void ToonStateChanged(ulong toonId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"game account id {toonId}");
|
Logger.MethodTrace($"game account id {toonId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"tsc|{toonId}"));
|
BattleNetSocketSend($"tsc|{toonId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UniqueItemIdentified(ulong gameAccountId, ulong itemId)
|
public void UniqueItemIdentified(ulong gameAccountId, ulong itemId)
|
||||||
{
|
{
|
||||||
Logger.MethodTrace($"gameAccountId {gameAccountId}, itemId {itemId}");
|
Logger.MethodTrace($"gameAccountId {gameAccountId}, itemId {itemId}");
|
||||||
BattleNetSocketSend(Encoding.UTF8.GetBytes($"uii|{gameAccountId}/{itemId}"));
|
BattleNetSocketSend($"uii|{gameAccountId}/{itemId}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -447,7 +447,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interlocked.Add(ref _tickCounter, (TickRate + MissedTicks)); // +6 ticks per 100ms. Verified by setting LogoutTickTimeMessage.Ticks to 600 which eventually renders a 10 sec logout timer on client. /raist
|
Interlocked.Add(ref _tickCounter, TickRate + MissedTicks); // +6 ticks per 100ms. Verified by setting LogoutTickTimeMessage.Ticks to 600 which eventually renders a 10 sec logout timer on client. /raist
|
||||||
MissedTicks = 0;
|
MissedTicks = 0;
|
||||||
|
|
||||||
if (UpdateEnabled && !Paused)
|
if (UpdateEnabled && !Paused)
|
||||||
@ -490,7 +490,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
if (_tickWatch.ElapsedMilliseconds > UpdateFrequency)
|
if (_tickWatch.ElapsedMilliseconds > UpdateFrequency)
|
||||||
{
|
{
|
||||||
Logger.Trace("Game.Update() took [{0}ms] more than Game.UpdateFrequency [{1}ms].", _tickWatch.ElapsedMilliseconds, UpdateFrequency);
|
Logger.Trace("Game.Update() took [{0}ms] more than Game.UpdateFrequency [{1}ms].", _tickWatch.ElapsedMilliseconds, UpdateFrequency);
|
||||||
compensation = (int)(UpdateFrequency - (_tickWatch.ElapsedMilliseconds % UpdateFrequency));
|
compensation = (int)(UpdateFrequency - _tickWatch.ElapsedMilliseconds % UpdateFrequency);
|
||||||
MissedTicks = TickRate * (int)(_tickWatch.ElapsedMilliseconds / UpdateFrequency);
|
MissedTicks = TickRate * (int)(_tickWatch.ElapsedMilliseconds / UpdateFrequency);
|
||||||
}
|
}
|
||||||
_calcWatch.Stop();
|
_calcWatch.Stop();
|
||||||
@ -646,7 +646,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
TiredRiftPaticipatingHeroID = new long[] { 0x0, 0x0, 0x0, 0x0 }, //TiredRiftPaticipatingHeroID
|
TiredRiftPaticipatingHeroID = new long[] { 0x0, 0x0, 0x0, 0x0 }, //TiredRiftPaticipatingHeroID
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if ((CurrentStep == -1 || CurrentAct == 400) && (CurrentQuest == QuestsOrder[0]) && CurrentAct != 3000)
|
if ((CurrentStep == -1 || CurrentAct == 400) && CurrentQuest == QuestsOrder[0] && CurrentAct != 3000)
|
||||||
{
|
{
|
||||||
switch (CurrentAct)
|
switch (CurrentAct)
|
||||||
{
|
{
|
||||||
@ -748,7 +748,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
if (!PvP && !((CurrentStep == -1) && (CurrentQuest == QuestsOrder[0])))
|
if (!PvP && !(CurrentStep == -1 && CurrentQuest == QuestsOrder[0]))
|
||||||
{
|
{
|
||||||
joinedPlayer.InGameClient.SendMessage(new QuestUpdateMessage()
|
joinedPlayer.InGameClient.SendMessage(new QuestUpdateMessage()
|
||||||
{
|
{
|
||||||
@ -1161,8 +1161,8 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
var handicapLevels = (GameBalance)MPQStorage.Data.Assets[SNOGroup.GameBalance][256027].Data;
|
var handicapLevels = (GameBalance)MPQStorage.Data.Assets[SNOGroup.GameBalance][256027].Data;
|
||||||
HPModifier = handicapLevels.HandicapLevelTables[diff].HPMod;
|
HPModifier = handicapLevels.HandicapLevelTables[diff].HPMod;
|
||||||
DmgModifier = handicapLevels.HandicapLevelTables[diff].DmgMod;
|
DmgModifier = handicapLevels.HandicapLevelTables[diff].DmgMod;
|
||||||
XPModifier = (1f + handicapLevels.HandicapLevelTables[diff].XPMod);
|
XPModifier = 1f + handicapLevels.HandicapLevelTables[diff].XPMod;
|
||||||
GoldModifier = (1f + handicapLevels.HandicapLevelTables[diff].GoldMod);
|
GoldModifier = 1f + handicapLevels.HandicapLevelTables[diff].GoldMod;
|
||||||
}
|
}
|
||||||
foreach (var wld in _worlds)
|
foreach (var wld in _worlds)
|
||||||
foreach (var monster in wld.Value.Monsters)
|
foreach (var monster in wld.Value.Monsters)
|
||||||
@ -1258,7 +1258,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
BlueTeamWins++;
|
BlueTeamWins++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurrentPvPRound > 5 || Math.Abs(RedTeamWins - BlueTeamWins) > (5 - CurrentPvPRound))
|
if (CurrentPvPRound > 5 || Math.Abs(RedTeamWins - BlueTeamWins) > 5 - CurrentPvPRound)
|
||||||
{
|
{
|
||||||
BroadcastMessage("Battle is over!");
|
BroadcastMessage("Battle is over!");
|
||||||
try
|
try
|
||||||
@ -1271,7 +1271,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
//foreach (var player in this.Players.Values)
|
//foreach (var player in this.Players.Values)
|
||||||
//player.World.BuffManager.AddBuff(player, player, new Mooege.Core.GS.Powers.Implementations.PVPRoundEndBuff(TickTimer.WaitSeconds(this, 1200.0f)));
|
//player.World.BuffManager.AddBuff(player, player, new Mooege.Core.GS.Powers.Implementations.PVPRoundEndBuff(TickTimer.WaitSeconds(this, 1200.0f)));
|
||||||
foreach (var plr in Players.Keys)
|
foreach (var plr in Players.Keys)
|
||||||
plr.SendMessage(new DataIDDataMessage(Opcodes.PVPArenaWin) { Field0 = (RedTeamWins == BlueTeamWins ? 0 : (RedTeamWins < BlueTeamWins ? 2 : 3)) });
|
plr.SendMessage(new DataIDDataMessage(Opcodes.PVPArenaWin) { Field0 = RedTeamWins == BlueTeamWins ? 0 : RedTeamWins < BlueTeamWins ? 2 : 3 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1294,7 +1294,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
//foreach (var player in this.Players.Values)
|
//foreach (var player in this.Players.Values)
|
||||||
//player.World.BuffManager.AddBuff(player, player, new Mooege.Core.GS.Powers.Implementations.PVPRoundEndBuff(TickTimer.WaitSeconds(this, 1200.0f)));
|
//player.World.BuffManager.AddBuff(player, player, new Mooege.Core.GS.Powers.Implementations.PVPRoundEndBuff(TickTimer.WaitSeconds(this, 1200.0f)));
|
||||||
foreach (var plr in Players.Keys)
|
foreach (var plr in Players.Keys)
|
||||||
plr.SendMessage(new DataIDDataMessage(Opcodes.PVPArenaWin) { Field0 = (RedTeamWins == BlueTeamWins ? 0 : (RedTeamWins < BlueTeamWins ? 2 : 3)) });
|
plr.SendMessage(new DataIDDataMessage(Opcodes.PVPArenaWin) { Field0 = RedTeamWins == BlueTeamWins ? 0 : RedTeamWins < BlueTeamWins ? 2 : 3 });
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1745,7 +1745,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
.Union(((DiIiS_NA.Core.MPQ.FileFormats.Act)MPQStorage.Data.Assets[SNOGroup.Act][70018].Data).WayPointInfo)
|
.Union(((DiIiS_NA.Core.MPQ.FileFormats.Act)MPQStorage.Data.Assets[SNOGroup.Act][70018].Data).WayPointInfo)
|
||||||
.Union(((DiIiS_NA.Core.MPQ.FileFormats.Act)MPQStorage.Data.Assets[SNOGroup.Act][236915].Data).WayPointInfo)
|
.Union(((DiIiS_NA.Core.MPQ.FileFormats.Act)MPQStorage.Data.Assets[SNOGroup.Act][236915].Data).WayPointInfo)
|
||||||
.Where(w => w.SNOWorld != -1).ToList();
|
.Where(w => w.SNOWorld != -1).ToList();
|
||||||
var wayPointInfo = actData.Where(w => w.Flags == 3 || (isOpenWorld ? (w.Flags == 2) : (w.Flags == 1))).ToList();
|
var wayPointInfo = actData.Where(w => w.Flags == 3 || (isOpenWorld ? w.Flags == 2 : w.Flags == 1)).ToList();
|
||||||
//Logger.Debug("GetWayPointWorldById: world id {0}", wayPointInfo[id].SNOWorld);
|
//Logger.Debug("GetWayPointWorldById: world id {0}", wayPointInfo[id].SNOWorld);
|
||||||
return GetWorld((WorldSno)wayPointInfo[id].SNOWorld);
|
return GetWorld((WorldSno)wayPointInfo[id].SNOWorld);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
for (int coreId = 0; coreId < CPUCount; coreId++)
|
for (int coreId = 0; coreId < CPUCount; coreId++)
|
||||||
{
|
{
|
||||||
var thread = new GameUpdateThread();
|
var thread = new GameUpdateThread();
|
||||||
thread.CPUAffinity = (1UL << coreId);
|
thread.CPUAffinity = 1UL << coreId;
|
||||||
UpdateWorkers.Add(thread);
|
UpdateWorkers.Add(thread);
|
||||||
var loopThread = new Thread(thread.Run) { Name = "UpdateWorkerThread", IsBackground = true }; ; // create the game update thread.
|
var loopThread = new Thread(thread.Run) { Name = "UpdateWorkerThread", IsBackground = true }; ; // create the game update thread.
|
||||||
loopThread.Start();
|
loopThread.Start();
|
||||||
|
|||||||
@ -96,7 +96,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
|
|||||||
if (_tickWatch.ElapsedMilliseconds > 100)
|
if (_tickWatch.ElapsedMilliseconds > 100)
|
||||||
{
|
{
|
||||||
Logger.Trace("Game.Update() took [{0}ms] more than Game.UpdateFrequency [{1}ms].", _tickWatch.ElapsedMilliseconds, 100);
|
Logger.Trace("Game.Update() took [{0}ms] more than Game.UpdateFrequency [{1}ms].", _tickWatch.ElapsedMilliseconds, 100);
|
||||||
compensation = (int)(100 - (_tickWatch.ElapsedMilliseconds % 100));
|
compensation = (int)(100 - _tickWatch.ElapsedMilliseconds % 100);
|
||||||
missedTicks = 6 * (int)(_tickWatch.ElapsedMilliseconds / 100);
|
missedTicks = 6 * (int)(_tickWatch.ElapsedMilliseconds / 100);
|
||||||
Thread.Sleep(Math.Max(0, compensation)); // sleep until next Update().
|
Thread.Sleep(Math.Max(0, compensation)); // sleep until next Update().
|
||||||
}
|
}
|
||||||
|
|||||||
@ -455,7 +455,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
{
|
{
|
||||||
snoQuest = questId,
|
snoQuest = questId,
|
||||||
annMeter = Meterid,
|
annMeter = Meterid,
|
||||||
flMeter = (QuestTimerEstimate / duration)
|
flMeter = QuestTimerEstimate / duration
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
@ -571,7 +571,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
if (trigger.Value.triggerType == QuestStepObjectiveType.HadConversation)
|
if (trigger.Value.triggerType == QuestStepObjectiveType.HadConversation)
|
||||||
foreach (var world in Game.Worlds)
|
foreach (var world in Game.Worlds)
|
||||||
{
|
{
|
||||||
var actors = world.Actors.Values.Where(d => d.Visible && (d is InteractiveNPC) && (d as InteractiveNPC).Conversations.Any(c => c.ConversationSNO == trigger.Key));
|
var actors = world.Actors.Values.Where(d => d.Visible && d is InteractiveNPC && (d as InteractiveNPC).Conversations.Any(c => c.ConversationSNO == trigger.Key));
|
||||||
Actor actor = null;
|
Actor actor = null;
|
||||||
if (actors.Count() == 1) actor = actors.First();
|
if (actors.Count() == 1) actor = actors.First();
|
||||||
if (actor != null)
|
if (actor != null)
|
||||||
@ -674,9 +674,9 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
{
|
{
|
||||||
if (strictFilter)
|
if (strictFilter)
|
||||||
{
|
{
|
||||||
if ((Game.CurrentQuest == snoQuest) && (Game.CurrentStep == Step)
|
if (Game.CurrentQuest == snoQuest && Game.CurrentStep == Step
|
||||||
||
|
||
|
||||||
(Game.CurrentSideQuest == snoQuest) && (Game.CurrentSideStep == Step))
|
Game.CurrentSideQuest == snoQuest && Game.CurrentSideStep == Step)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -718,7 +718,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
public bool IsInQuestRange(QuestRange range)
|
public bool IsInQuestRange(QuestRange range)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (range.Header.SNOId == 312431) return (Game.CurrentAct == 3000);
|
if (range.Header.SNOId == 312431) return Game.CurrentAct == 3000;
|
||||||
if (range.Header.SNOId == 214766) return true;
|
if (range.Header.SNOId == 214766) return true;
|
||||||
|
|
||||||
bool started = false;
|
bool started = false;
|
||||||
@ -927,7 +927,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
StepID = 4,
|
StepID = 4,
|
||||||
TaskIndex = AdditionalTaskId,
|
TaskIndex = AdditionalTaskId,
|
||||||
Counter = AdditionalTargetCounter,
|
Counter = AdditionalTargetCounter,
|
||||||
Checked = (AdditionalTargetNeed <= AdditionalTargetCounter) ? 1 : 0
|
Checked = AdditionalTargetNeed <= AdditionalTargetCounter ? 1 : 0
|
||||||
});
|
});
|
||||||
if (MonsterCount < AdditionalTargetCounter + 20)
|
if (MonsterCount < AdditionalTargetCounter + 20)
|
||||||
{
|
{
|
||||||
@ -1015,7 +1015,7 @@ namespace DiIiS_NA.D3_GameServer.GSSystem.GameSystem
|
|||||||
{
|
{
|
||||||
foreach (var player in QuestManager.Game.Players.Values)
|
foreach (var player in QuestManager.Game.Players.Values)
|
||||||
{
|
{
|
||||||
var xpReward = 1000 * player.Level * (1 + (player.Level / 7)) * QuestManager.Game.XPModifier;
|
var xpReward = 1000 * player.Level * (1 + player.Level / 7) * QuestManager.Game.XPModifier;
|
||||||
if (Type == BountyData.BountyType.KillUnique)
|
if (Type == BountyData.BountyType.KillUnique)
|
||||||
xpReward *= 1.8f;
|
xpReward *= 1.8f;
|
||||||
if (Type == BountyData.BountyType.ClearDungeon)
|
if (Type == BountyData.BountyType.ClearDungeon)
|
||||||
|
|||||||
Loading…
Reference in New Issue
user.block.title