Small changes: swap and mod
This commit is contained in:
parent
c6061f2052
commit
bf2a4fdcfa
3
.gitignore
vendored
3
.gitignore
vendored
@ -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
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
user.block.title