Small changes: swap and mod

This commit is contained in:
Lucca (Droppy) 2024-04-29 05:51:03 +00:00
parent c6061f2052
commit bf2a4fdcfa
4 changed files with 17 additions and 12 deletions

3
.gitignore vendored
View File

@ -370,3 +370,6 @@ FodyWeavers.xsd
db/data/pgdata/
db/pgadmin/*
!db/pgadmin/pgpass
/src/DiIiS-NA/config.ini
/src/DiIiS-NA/database.Account.config
/src/DiIiS-NA/database.Worlds.config

View File

@ -32,9 +32,7 @@
{
index2 = (byte)(key[index1] + _state[counter] + index2);
// swap byte
byte tmp = _state[counter];
_state[counter] = _state[index2];
_state[index2] = tmp;
(_state[counter], _state[index2]) = (_state[index2], _state[counter]);
index1 = (byte)((index1 + 1) % key.Length);
}
}
@ -46,9 +44,7 @@
x = (byte)(x + 1);
y = (byte)(_state[x] + y);
// swap byte
byte tmp = _state[x];
_state[x] = _state[y];
_state[y] = tmp;
(_state[x], _state[y]) = (_state[y], _state[x]);
byte xorIndex = (byte)(_state[x] + _state[y]);
outputBuffer[outputOffset + counter] = (byte)(inputBuffer[inputOffset + counter] ^ _state[xorIndex]);

View File

@ -35,8 +35,14 @@ namespace DiIiS_NA.Core.Storage.AccountDataBase
if (_config == null)
{
_config = new Configuration();
#if DEBUG
if (File.Exists(Path.Combine(FileHelpers.AssemblyRoot, "database.Account.Debug.config")))
_config = _config.Configure(Path.Combine(FileHelpers.AssemblyRoot, "database.Account.Debug.config"));
else
_config = _config.Configure(Path.Combine(FileHelpers.AssemblyRoot, "database.Account.config"));
#else
_config = _config.Configure(Path.Combine(FileHelpers.AssemblyRoot, "database.Account.config"));
#endif
var replacedProperties = new Dictionary<string, string>();
foreach (var prop in _config.Properties)

View File

@ -155,7 +155,7 @@ public class GameModsConfig
return;
}
Logger.Fatal("An error occured whilst loading $[white on red]$config.mods.json$[/]$ file. Please verify if the file is correct. Delete the file and try again.");
Logger.Fatal("An error occurred whilst loading $[white on red]$config.mods.json$[/]$ file. Please verify if the file is correct. Delete the file and try again.");
Program.Shutdown(ex);
}
}