Skip to content

Commit

Permalink
Updates and Bug fixes
Browse files Browse the repository at this point in the history
- Config.json IP corrected to avoid vague connection error
- Config.json Properly implemented relative paths (replacing basic / implementation)
- Config.json added DumpDirectory to the Grim section (used by DumpUpdater and SPR Generator)
- Config.json implemented DumpUpdater SPR sections
- Configuration\ConfigMan.cs GetByteArray and UpdateByteArray methods implemented to support use of Modified XOR Keys
- Configuration\ConfigMan.cs GetDirectory logic reimplement to properly implement relative path usage
- DB\DBEvent.cs database event arguments implemented to support upgrading DBHelper reporting through events
- DB\DBHelper.cs missing table backup during export properly implemented
- DB\DBHelper.cs missing table drop/restore during export properly implemented
- DB\DBHelper.cs execute logic corrected and now supports open/closing connection and returning active DbDataReader
- GUI/DumpUpdater.cs implemented
- GUI/SPRGenerator.cs implemented
- GUI/XOREditor.cs implemented
- GUI/Main.cs altered to support DumpUpdater/SPRGenerator and XOREditor
- GUI/MessageListBox.cs new constructer implemented to alter the message box to be a notice
- Structures/Settings.cs updated to support new utilities and DBHelper updates
- Structures/SprInfo.cs implemented to support SPR Generator
- Tabs/Manager.cs updated to allowing clearing the Hasher tab like the other tab styles
- Tabs/Styles/Data.cs check_locations method implemented to check misplaces files in a dump directory before a build to avoid vague errors
- Tabs/Styles/Data.cs TS_File_New_Click event logic updated to check locations before indexing
- Tabs/Styles/Data.cs insert_files logic improved to utilize update to DataCore so that single files/multiple files are processed accordingly (fixes backup crash loop when inserting many files)
- Tabs/Styles/Hasher.cs Clear() logic implemented
- Tabs/Styles/RDB.cs database related logic updated (now RDBTab hooks events from the DBHelper
  • Loading branch information
iSmokeDrow committed Jan 15, 2021
1 parent fead36e commit 6341f88
Show file tree
Hide file tree
Showing 28 changed files with 2,425 additions and 2,523 deletions.
28 changes: 19 additions & 9 deletions Config.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
{
"Grim": {
"BuildDirectory": "/Output",
"BuildDirectory": ".\\Output",
"DumpDirectory": "",
"Codepage": 1252
},
"Tab": {
"Styles": [
"RDB",
"DATA",
"HASHER",
"HASHER"
],
"DefaultStyle": "NONE"
},
"DB": {
"Engine": 0,
"IP": "127.0.0.1",
"IP": "(local)",
"Port": 1433,
"Trusted": true,
"WorldName": "Arcadia",
"WorldUser": "",
"WorldPass": "",
"Backup": false,
"DropOnExport": false,
"ScriptsDirectory": ".\\Scripts",
"Timeout": 0
},
"RDB": {
"Struct_AutoLoad": true,
"Directory": "/Structures",
"Directory": ".\\Structures",
"Encoding": "Western Europe",
"LoadDirectory": "",
"AppendASCII": true,
"SaveHashed": true,
"CSV_Directory": "/CSV",
"SQL_Directory": "/SQL"
"CSV_Directory": ".\\CSV",
"SQL_Directory": ".\\SQL"
},
"Data": {
"LoadDirectory": "C:\\Webzen\\Rappelz US",
Expand All @@ -48,19 +50,27 @@
"Type": 0
},
"Log": {
"Directory": "/Logs",
"Directory": ".\\Logs",
"DisplayLevel": 0,
"WriteLevel": 0,
"RefreshInterval": 2,
"SaveOnExit": true
},
"Flag": {
"Directory": "/Flags",
"Directory": ".\\Flags",
"Default": "use_flags_81",
"ClearOnChange": false
},
"DumpUpdater": {
"OverwriteExisting": false
},
"SPR": {
"IgnoreSize": true,
"ShowWarnings": true,
"ShowIgnored": true
},
"Localization": {
"Directory": "/Localization",
"Directory": ".\\Localization",
"Locale": "en-US"
}
}
44 changes: 25 additions & 19 deletions Configuration/ConfigMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public byte[] GetByteArray(string key)
if (idx == -1)
throw new KeyNotFoundException();

int[] val = Options[idx].Value.ToArray();
int[] val = Options[idx].Value;
byte[] ret = new byte[val.Length];

for (int i = 0; i < ret.Length; i++)
Expand All @@ -148,29 +148,35 @@ public byte[] GetByteArray(string key)
return ret ?? null;
}

public void UpdateByteArray(string key, byte[] array)
{
int idx = Options.FindIndex(o => o.Name == key);

if (idx == -1)
throw new KeyNotFoundException();

int[] nArray = new int[array.Length];

for (int i = 0; i < nArray.Length; i++)
nArray[i] = (int)array[i];

Options[idx].Value = nArray;
}

public string GetDirectory(string key, string parent = null)
{
Option opt = (parent != null) ? GetOption(key, parent) : GetOption(key);

string fileDir = null;
string filePath = null;
string valStr = opt.Value;

if (valStr.StartsWith("/")) //Only the folder name is given
{
string workingDir = Directory.GetCurrentDirectory();
fileDir = workingDir;
valStr = valStr.Replace("/", "\\");
}
else
fileDir = valStr;
string optPath = opt.Value;
bool isRelative = !Path.IsPathRooted(optPath);

if (fileDir == valStr)
filePath = fileDir;
else
filePath = $"{fileDir}{valStr as string}";
if (!string.IsNullOrEmpty(optPath))
if (!isRelative)
return optPath;
else
return Path.GetFullPath(optPath);

return filePath;
return null;
}

void parse()
Expand Down Expand Up @@ -204,7 +210,7 @@ void parse()
foreach (var item in val.Value.Children())
array.Add((int)item.Value);

value = array;
value = array.ToArray();
}
else
{
Expand Down
50 changes: 50 additions & 0 deletions DB/DBEvents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Grimoire.DB
{
public class DBError : EventArgs
{
public DBError(string message) => Message = message;

public string Message;
}

public class DBProgressMax : EventArgs
{
public DBProgressMax(int maximum) => Maximum = maximum;

public DBProgressMax(int maximum, string message)
{
Maximum = maximum;
Message = message;
}

public int Maximum;
public string Message;
}

public class DBProgressValue : EventArgs
{
public DBProgressValue(int value) => Value = value;

public DBProgressValue(int value, string message)
{
Value = value;
Message = message;
}

public int Value;
public string Message;
}

public class DBMessage : EventArgs
{
public DBMessage(string message) => Message = message;

public string Message;
}
}
Loading

0 comments on commit 6341f88

Please sign in to comment.