-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracer for debug fixes
- Loading branch information
Showing
20 changed files
with
454 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
using System; | ||
|
||
namespace Destiny.IO | ||
{ | ||
public class Tracer | ||
{ | ||
#region traceError | ||
public static void TraceErrorMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
Log.Error("Error message: {0}", message); | ||
Log.Error("Method/Property name: {0}", memberName); | ||
Log.Error("Source file path: {0}", sourceFilePath); | ||
Log.Error("Source file line number: {0}", sourceLineNumber); | ||
} | ||
|
||
public static void TraceErrorMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0, params object[] args) | ||
{ | ||
Log.Error("Error message: {0}", message); | ||
Log.Error("Method/Property name: {0}", memberName); | ||
Log.Error("Source file path: {0}", sourceFilePath); | ||
Log.Error("Source file line number: {0}", sourceLineNumber); | ||
Log.Error("Additional debug info: {0}", args); | ||
} | ||
|
||
public static void TraceErrorMessage(Exception e, string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
Log.Error("Error message: {0}", message); | ||
Log.Error("Method/Property name: {0}", memberName); | ||
Log.Error("Source file path: {0}", sourceFilePath); | ||
Log.Error("Source file line number: {0}", sourceLineNumber); | ||
Log.Error("Exception information: {0}", e); | ||
} | ||
#endregion | ||
|
||
#region traceWarn | ||
public static void TraceWarnMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
Log.Warn("Error message: {0}", message); | ||
Log.Warn("Method/Property name: {0}", memberName); | ||
Log.Warn("Source file path: {0}", sourceFilePath); | ||
Log.Warn("Source file line number: {0}", sourceLineNumber); | ||
} | ||
|
||
public static void TraceWarnMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0, params object[] args) | ||
{ | ||
Log.Warn("Error message: {0}", message); | ||
Log.Warn("Method/Property name: {0}", memberName); | ||
Log.Warn("Source file path: {0}", sourceFilePath); | ||
Log.Warn("Source file line number: {0}", sourceLineNumber); | ||
Log.Warn("Additional debug info: {0}", args); | ||
} | ||
|
||
public static void TraceWarnMessage(Exception e, string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
Log.Warn("Error message: {0}", message); | ||
Log.Warn("Method/Property name: {0}", memberName); | ||
Log.Warn("Source file path: {0}", sourceFilePath); | ||
Log.Warn("Source file line number: {0}", sourceLineNumber); | ||
Log.Warn("Exception information: {0}", e); | ||
} | ||
#endregion | ||
|
||
#region traceInfo | ||
public static void TraceInfoMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0) | ||
{ | ||
Log.Inform("Error message: {0}", message); | ||
Log.Inform("Method/Property name: {0}", memberName); | ||
Log.Inform("Source file path: {0}", sourceFilePath); | ||
Log.Inform("Source file line number: {0}", sourceLineNumber); | ||
} | ||
|
||
public static void TraceInfoMessage(string message, | ||
[System.Runtime.CompilerServices.CallerMemberName] string memberName = "", | ||
[System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "", | ||
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0, params object[] args) | ||
{ | ||
Log.Inform("Error message: {0}", message); | ||
Log.Inform("Method/Property name: {0}", memberName); | ||
Log.Inform("Source file path: {0}", sourceFilePath); | ||
Log.Inform("Source file line number: {0}", sourceLineNumber); | ||
Log.Inform("Additional debug info: {0}", args); | ||
} | ||
#endregion traceInfo | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ public void Update(Packet iPacket) | |
this.VIP.Add(mapID); | ||
} | ||
} | ||
|
||
else | ||
{ | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/WvsGame/Maple/Commands/Implementation/SummonCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System; | ||
using Destiny.Maple.Characters; | ||
using Destiny.Maple.Life; | ||
|
||
namespace Destiny.Maple.Commands.Implementation | ||
{ | ||
public sealed class SummonCommand : Command | ||
{ | ||
public override string Name | ||
{ | ||
get | ||
{ | ||
return "summon"; | ||
} | ||
} | ||
|
||
public override string Parameters | ||
{ | ||
get | ||
{ | ||
return "{ skillID | exact name } [ amount ] "; | ||
} | ||
} | ||
|
||
public override bool IsRestricted | ||
{ | ||
get | ||
{ | ||
return true; | ||
} | ||
} | ||
|
||
public override void Execute(Character caller, string[] args) | ||
{ | ||
if (args.Length < 1) | ||
{ | ||
this.ShowSyntax(caller); | ||
} | ||
else | ||
{ | ||
int amount = 0; | ||
bool isAmountSpecified; | ||
|
||
if (args.Length > 1) | ||
{ | ||
isAmountSpecified = int.TryParse(args[args.Length - 1], out amount); | ||
} | ||
else | ||
{ | ||
isAmountSpecified = false; | ||
} | ||
|
||
if (amount < 1) | ||
{ | ||
amount = 1; | ||
} | ||
|
||
int skillID = -1; | ||
|
||
try | ||
{ | ||
skillID = int.Parse(args[0]); | ||
} | ||
catch (FormatException) | ||
{ | ||
// TODO: Fetch from strings. | ||
} | ||
|
||
Skill skillToSummonFrom = CharacterSkills.GetNewSkillFromInt(skillID); | ||
Summon summon = Summon.GetNewSummonFromSkill(skillToSummonFrom); | ||
|
||
// TODO: disperse multiple spawn, they are called with identical position thus overlap | ||
for (int i = 0; i < amount; i++) | ||
{ | ||
caller.Map.Summons.Add(summon); | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.