Skip to content

Commit

Permalink
Update Project to v2.1.0
Browse files Browse the repository at this point in the history
- update project to v2.1.0
- update README.md
- update COMMANDS.md
- update CHANGELOG.md
  • Loading branch information
SCHREDDO committed May 7, 2020
1 parent aa231e0 commit 17d91eb
Show file tree
Hide file tree
Showing 19 changed files with 305 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ x64/
x86/
bld/
[Bb]in/
!build/bin
[Oo]bj/
[Ll]og/

Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog
## = 2.0.0 March 26th 2019 =
## = 2.1.0 May 7th 2020 =
### Added
- add possibility to analyzed Chat.log in background
- new parameter (`-i`) to analyzed Chat.log in background, command: dmg
- add check if all NerdyAion files exists by start from NerdyAion.exe
- add check if the set Aion folder exists (respectively system.cfg) by start from NerdyAion.exe
- add check if Chat.log exists by start from NerdyAion.exe
- add check if Aion.exe is running by start from NerdyAion.exe
- add check if nerdy.ini exists if not a default will be generated by start from NerdyAion.exe
- add check if base.conf exists if not a default will be generated by start from NerdyAion.exe
### Fixed
- NerdyAion will no longer crash if Chat.log does not exists
## = 2.0.0 April 22th 2020 =
### Added
- new setting: dmg_template
- new setting: show_max
Expand Down
5 changes: 4 additions & 1 deletion COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ For handling damage information.

Syntax:
```console
dmg <add | list | clear | remove | show | copy> [pointer name]
dmg <add | list | clear | remove | show | copy> [-i] [pointer name]
```
```console
dmg add <pointer name>
dmg add [-i] <pointer name>
dmg list
dmg clear <pointer name>
dmg remove <pointer name>
Expand All @@ -108,6 +109,7 @@ dmg copy <pointer name>
```
Arguments:
- `add`: add a pointer (start point) for the analyzing with the given name `<pointer name>`
- `-i`: the Chat.log will be analyzed in background else only when `dmg show <pointer name>`
- `list`: shows all pointer.
- `clear`: reset a given pointer
- `remove`: remove a given pointer
Expand All @@ -118,6 +120,7 @@ Arguments:
Example:
```console
dmg add boss
dmg add -i tf
dmg list
dmg clear boss
dmg remove boss
Expand Down
56 changes: 48 additions & 8 deletions NerdyAion/Damage/Damage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//
// Created By: Sebastian Lühnen
// Created On: 06.04.2019
// Last Edited On: 21.04.2020
// Last Edited On: 04.05.2020
// Language: C#
//
using System;
Expand All @@ -33,16 +33,23 @@ namespace Damage
public class Damage : BaseCommand
{
public Dictionary<string, string> Analyzer { get; set; }
public Dictionary<string, bool> IsInterval { get; set; }

public override int Initialize(Dictionary<string, string> baseSettings, Dictionary<string, string> commandSettings)
{
Analyzer = new Dictionary<string, string>();
IsInterval = new Dictionary<string, bool>();

return 0;
}

public override int Execute(string command, object[] args, Dictionary<string, string> baseSettings, Dictionary<string, string> commandSettings)
{
if (!File.Exists($"{baseSettings["aion"]}{Path.DirectorySeparatorChar}Chat.log"))
{
return 4;
}

int code = 0;
if (args.Length == 1)
{
Expand All @@ -69,14 +76,37 @@ public override int Execute(string command, object[] args, Dictionary<string, st
{
if (!Analyzer.ContainsKey((String)args[1]))
{
Obj($"nda{args[1].ToString()}", "NerdyDamageAnalyzer.NerdyDamageAnalyzer", new object[] { $"{baseSettings["aion"]}{Path.DirectorySeparatorChar}Chat.log", baseSettings["language"], baseSettings["player"]}, this.CPatch("lib", "NerdyDamageanAlyzer.dll"));
Obj($"nda{args[1].ToString()}", "NerdyDamageAnalyzer.NerdyDamageAnalyzer", new object[] { $"{baseSettings["aion"]}{Path.DirectorySeparatorChar}Chat.log", baseSettings["language"], baseSettings["player"] }, this.CPatch("lib", "NerdyDamageanAlyzer.dll"));
Analyzer.Add(args[1].ToString(), $"nda{args[1].ToString()}");
IsInterval.Add(args[1].ToString(), false);
}
else
{
code = 2;
}
}
else if (args.Length == 3)
{
if (((String)args[1]) == "-i")
{
if (!Analyzer.ContainsKey((String)args[2]))
{
Obj($"nda{args[2].ToString()}", "NerdyDamageAnalyzer.NerdyDamageAnalyzer", new object[] { $"{baseSettings["aion"]}{Path.DirectorySeparatorChar}Chat.log", baseSettings["language"], baseSettings["player"] }, this.CPatch("lib", "NerdyDamageanAlyzer.dll"));
Analyzer.Add(args[2].ToString(), $"nda{args[2].ToString()}");
IsInterval.Add(args[2].ToString(), true);

ExMethod(Analyzer[(String)args[2]], "InitTimer", new object[] { }, new Type[] { });
}
else
{
code = 2;
}
}
else
{
code = 1;
}
}
else
{
code = 1;
Expand Down Expand Up @@ -106,6 +136,7 @@ public override int Execute(string command, object[] args, Dictionary<string, st
{
RemoveObj(Analyzer[(String)args[1]]);
Analyzer.Remove((String)args[1]);
IsInterval.Remove((String)args[1]);
}
else
{
Expand All @@ -122,7 +153,10 @@ public override int Execute(string command, object[] args, Dictionary<string, st
{
if (Analyzer.ContainsKey((String)args[1]))
{
ExMethod(Analyzer[(String)args[1]], "AnalyzeLog", new object[] { }, new Type[] { });
if (!IsInterval[(String)args[1]])
{
ExMethod(Analyzer[(String)args[1]], "AnalyzeLog", new object[] { }, new Type[] { });
}

ConsoleOut("==== PLAYER LIST ====");

Expand All @@ -147,7 +181,10 @@ public override int Execute(string command, object[] args, Dictionary<string, st
{
if (Analyzer.ContainsKey((String)args[1]))
{
ExMethod(Analyzer[(String)args[1]], "AnalyzeLog", new object[] { }, new Type[] { });
if (!IsInterval[(String)args[1]])
{
ExMethod(Analyzer[(String)args[1]], "AnalyzeLog", new object[] { }, new Type[] { });
}

List<String> temp = new List<String>();
temp = (List<String>)ExMethod(Analyzer[(String)args[1]], "Show", new object[] { baseSettings["dmg_template"], baseSettings["sort_by"], Convert.ToInt32(baseSettings["show_max"]) }, new Type[] { typeof(String), typeof(String), typeof(int) });
Expand Down Expand Up @@ -186,6 +223,7 @@ public override Dictionary<string, string> CInfo()
info.Add("i1", "Unknown argument or arguments. Try 'help dmg' for help.");
info.Add("i2", "Pointer already exists.");
info.Add("i3", "Pointer does not exists.");
info.Add("i4", "Chat.log does not exists.");

return info;
}
Expand All @@ -195,10 +233,10 @@ public override string CHelp()
return "For handling damage information.\n\n"
+ "Syntax:\n"
+ "```console\n"
+ "dmg <add | list | clear | remove | show | copy> [pointer name]\n"
+ "dmg <add | list | clear | remove | show | copy> [-i] [pointer name]\n"
+ "```\n"
+ "```console\n"
+ "dmg add <pointer name>\n"
+ "dmg add [-i] <pointer name>\n"
+ "dmg list\n"
+ "dmg clear <pointer name>\n"
+ "dmg remove <pointer name>\n"
Expand All @@ -207,15 +245,17 @@ public override string CHelp()
+ "```\n\n"
+ "Arguments:\n"
+ "-`add`: add a pointer(start point) for the analyzing with the given name `<pointer name>`\n"
+ "-`-i`: the Chat.log will be analyz in background else only when `dmg show <pointer name>`"
+ "-`list`: shows all pointer.\n"
+ "-`clear`: reset a given pointer\n"
+ "-`remove`: remove a given pointer\n"
+ "-`show`: Shows damage information of a given pointer\n"
+ "-`copy`: Copy damage information of a given pointer\n"
+ "-`show`: shows damage information of a given pointer\n"
+ "-`copy`: copy damage information of a given pointer\n"
+ "-`pointer name`: the pointer name\n\n"
+ "Example:\n"
+ "```console\n"
+ "dmg add boss\n"
+ "dmg add -i tf\n"
+ "dmg list\n"
+ "dmg clear boss\n"
+ "dmg remove boss\n"
Expand Down
Loading

0 comments on commit 17d91eb

Please sign in to comment.