Skip to content

Commit 8db2fee

Browse files
committed
formatt
1 parent d12fc2b commit 8db2fee

File tree

575 files changed

+4764
-4860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

575 files changed

+4764
-4860
lines changed

Akiled Emulator.sln

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Global
2525
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2626
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2727
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Any CPU.Build.0 = Debug|Any CPU
28-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
29-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Mixed Platforms.Build.0 = Debug|x86
30-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x64.ActiveCfg = Debug|x64
31-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x64.Build.0 = Debug|x64
32-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x86.ActiveCfg = Debug|x86
33-
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x86.Build.0 = Debug|x86
28+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
29+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
30+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x64.ActiveCfg = Debug|Any CPU
31+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x64.Build.0 = Debug|Any CPU
32+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x86.ActiveCfg = Debug|Any CPU
33+
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Debug|x86.Build.0 = Debug|Any CPU
3434
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Release|Any CPU.ActiveCfg = Release|Any CPU
3535
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Release|Any CPU.Build.0 = Release|Any CPU
3636
{6C37DB6F-DA4A-4078-9B8C-2F2F5C10AC09}.Release|Mixed Platforms.ActiveCfg = Release|x86

AkiledEmulator.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@
107107
<ItemGroup>
108108
<PackageReference Include="discord-webhook-client" Version="3.1.0" />
109109
<PackageReference Include="log4net" Version="2.0.15" />
110-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
110+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
111111
<PackageReference Include="Nancy" Version="2.0.0" />
112-
<PackageReference Include="Scrutor" Version="4.1.0" />
112+
<PackageReference Include="Scrutor" Version="4.2.0" />
113113
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
114-
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="6.0.0" />
114+
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="6.0.1" />
115115
<PackageReference Include="System.Net.Http" Version="4.3.4" />
116116
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
117-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
118-
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.326103">
117+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
118+
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.346202">
119119
<PrivateAssets>all</PrivateAssets>
120120
</PackageReference>
121121
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />

AkiledEnvironment.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public AkiledEnvironment(
140140

141141

142142

143-
public static async Task<bool> Initialize()
143+
public static Task<bool> Initialize()
144144
{
145145
Console.Clear();
146146
AkiledEnvironment.ServerStarted = DateTime.Now;
@@ -187,7 +187,7 @@ public static async Task<bool> Initialize()
187187
Logging.WriteLine("Error al conectar con el Mysql Server.");
188188
Console.ReadKey(true);
189189
Environment.Exit(1);
190-
return false;
190+
return Task.FromResult(false);
191191
}
192192
}
193193
HabboEncryptionV2.Initialize(new RSAKeys());
@@ -230,24 +230,24 @@ public static async Task<bool> Initialize()
230230
Logging.WriteLine("Press any key to shut down ...");
231231
Logging.WriteLine(ex.ToString());
232232
Console.ReadKey(true);
233-
return false;
233+
return Task.FromResult(false);
234234
}
235235
catch (InvalidOperationException ex)
236236
{
237237
Logging.WriteLine("Failed to initialize AkiledEmulator: " + ex.Message);
238238
Logging.WriteLine("Press any key to shut down ...");
239239
Console.ReadKey(true);
240-
return false;
240+
return Task.FromResult(false);
241241
}
242242
catch (Exception ex)
243243
{
244244
Console.WriteLine("Fatal error during startup: " + ex.ToString());
245245
Console.WriteLine("Press a key to exit");
246246
Console.ReadKey();
247247
Environment.Exit(1);
248-
return false;
248+
return Task.FromResult(false);
249249
}
250-
return true;
250+
return Task.FromResult(true);
251251
}
252252

253253

Communication/ConnectionManager/GameSocketManager.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class GameSocketManager
1515
private int acceptedConnections;
1616
private IDataParser parser;
1717
private ConcurrentDictionary<string, int> _ipConnectionsCount;
18-
18+
1919
public event ConnectionEvent connectionEvent;
2020

2121
public void init(int portID, int connectionsPerIP, IDataParser parser, bool DisabledProtect = false)
@@ -35,7 +35,7 @@ public void init(int portID, int connectionsPerIP, IDataParser parser, bool Disa
3535
this.connectionListener.SendBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
3636
this.connectionListener.ReceiveBufferSize = GameSocketManagerStatics.BUFFER_SIZE;
3737
}
38-
catch(Exception ex)
38+
catch (Exception ex)
3939
{
4040
this.Destroy();
4141
Console.WriteLine(ex);
@@ -76,7 +76,7 @@ private void newConnectionRequest(IAsyncResult iAr)
7676
Interlocked.Increment(ref this.acceptedConnections);
7777

7878
ConnectionInformation connection = new ConnectionInformation(dataStream, this.acceptedConnections, this.parser.Clone() as IDataParser, Ip);
79-
79+
8080
connection.connectionClose += new ConnectionInformation.ConnectionChange(this.c_connectionChanged);
8181

8282
reportUserLogin(Ip);

Communication/Encryption/Crypto/RSA/RSAKey.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using System;
2-
3-
using Akiled.Utilities;
1+
using Akiled.Utilities;
2+
using System;
43

54
namespace Akiled.Communication.Encryption.Crypto.RSA
65
{
@@ -112,7 +111,7 @@ public static RSAKey ParsePrivateKey(string n, string e,
112111
}
113112
else
114113
{
115-
return new RSAKey(new BigInteger(n, 16), Convert.ToInt32(e, 16), new BigInteger(d, 16), new BigInteger(p, 16), new BigInteger(q, 16),
114+
return new RSAKey(new BigInteger(n, 16), Convert.ToInt32(e, 16), new BigInteger(d, 16), new BigInteger(p, 16), new BigInteger(q, 16),
116115
new BigInteger(dmp1, 16), new BigInteger(dmq1, 16), new BigInteger(coeff, 16));
117116
}
118117
}

Communication/Encryption/HabboEncryptionV2.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System.Text;
2-
3-
using Akiled.Utilities;
4-
using Akiled.Communication.Encryption.Keys;
5-
using Akiled.Communication.Encryption.Crypto.RSA;
1+
using Akiled.Communication.Encryption.Crypto.RSA;
62
using Akiled.Communication.Encryption.KeyExchange;
3+
using Akiled.Communication.Encryption.Keys;
4+
using Akiled.Utilities;
5+
using System.Text;
76

87
namespace Akiled.Communication.Encryption
98
{

Communication/Encryption/KeyExchange/DiffieHellman.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using System;
2-
3-
using Akiled.Utilities;
1+
using Akiled.Utilities;
2+
using System;
43

54
namespace Akiled.Communication.Encryption.KeyExchange
65
{

Communication/Encryption/Utils/BigInteger.cs

+22-22
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,24 @@ public class BigInteger
147147
public static readonly int[] primesBelow2000 = {
148148
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97,
149149
101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199,
150-
211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,
151-
307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397,
152-
401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,
153-
503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599,
154-
601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,
155-
701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797,
156-
809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887,
157-
907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997,
158-
1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,
159-
1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193,
160-
1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297,
161-
1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,
162-
1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499,
163-
1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597,
164-
1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699,
165-
1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,
166-
1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
167-
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999 };
150+
211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,
151+
307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397,
152+
401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,
153+
503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599,
154+
601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,
155+
701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797,
156+
809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887,
157+
907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997,
158+
1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,
159+
1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193,
160+
1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297,
161+
1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,
162+
1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499,
163+
1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597,
164+
1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699,
165+
1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,
166+
1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
167+
1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999 };
168168

169169

170170
private uint[] data = null; // stores bytes from the Big Integer
@@ -785,7 +785,7 @@ private static int shiftLeft(uint[] buffer, int shiftVal)
785785
while (bufLen > 1 && buffer[bufLen - 1] == 0)
786786
bufLen--;
787787

788-
for (int count = shiftVal; count > 0; )
788+
for (int count = shiftVal; count > 0;)
789789
{
790790
if (count < shiftAmount)
791791
shiftAmount = count;
@@ -858,7 +858,7 @@ private static int shiftRight(uint[] buffer, int shiftVal)
858858

859859
//Console.WriteLine("bufLen = " + bufLen + " buffer.Length = " + buffer.Length);
860860

861-
for (int count = shiftVal; count > 0; )
861+
for (int count = shiftVal; count > 0;)
862862
{
863863
if (count < shiftAmount)
864864
{
@@ -1002,7 +1002,7 @@ public override int GetHashCode()
10021002
if ((bi1.data[pos] & 0x80000000) != 0 && (bi2.data[pos] & 0x80000000) == 0)
10031003
return false;
10041004

1005-
// bi1 is positive, bi2 is negative
1005+
// bi1 is positive, bi2 is negative
10061006
else if ((bi1.data[pos] & 0x80000000) == 0 && (bi2.data[pos] & 0x80000000) != 0)
10071007
return true;
10081008

@@ -1028,7 +1028,7 @@ public override int GetHashCode()
10281028
if ((bi1.data[pos] & 0x80000000) != 0 && (bi2.data[pos] & 0x80000000) == 0)
10291029
return true;
10301030

1031-
// bi1 is positive, bi2 is negative
1031+
// bi1 is positive, bi2 is negative
10321032
else if ((bi1.data[pos] & 0x80000000) == 0 && (bi2.data[pos] & 0x80000000) != 0)
10331033
return false;
10341034

Communication/PacketParser/GamePacketParser.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using Akiled.HabboHotel.GameClients;
1+
using Akiled.Communication.Packets.Incoming;
2+
using Akiled.Communication.WebSocket;
3+
using Akiled.HabboHotel.GameClients;
4+
using Akiled.Utilities;
25
using SharedPacketLib;
36
using System;
47
using System.IO;
5-
using Akiled.Communication.Packets.Incoming;
6-
using System.Text;
7-
using Akiled.Utilities;
88
using System.Security.Cryptography;
9-
using Akiled.Communication.WebSocket;
9+
using System.Text;
1010

1111
namespace Akiled.Net
1212
{
@@ -174,6 +174,6 @@ public object Clone()
174174
}
175175

176176
public delegate void HandlePacket(ClientPacket message);
177-
177+
178178
}
179179
}

Communication/PacketParser/InitialPacketParser.cs

+21-21
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33

44
namespace Akiled.Net
55
{
6-
public class InitialPacketParser : IDataParser, IDisposable, ICloneable
7-
{
8-
public byte[] currentData;
6+
public class InitialPacketParser : IDataParser, IDisposable, ICloneable
7+
{
8+
public byte[] currentData;
99

10-
public event InitialPacketParser.NoParamDelegate SwitchParserRequest;
10+
public event InitialPacketParser.NoParamDelegate SwitchParserRequest;
1111

12-
public void handlePacketData(byte[] packet, bool deciphered = false)
13-
{
14-
if (this.SwitchParserRequest == null)
15-
return;
12+
public void handlePacketData(byte[] packet, bool deciphered = false)
13+
{
14+
if (this.SwitchParserRequest == null)
15+
return;
1616

17-
this.currentData = packet;
18-
this.SwitchParserRequest();
19-
}
17+
this.currentData = packet;
18+
this.SwitchParserRequest();
19+
}
2020

21-
public void Dispose()
22-
{
23-
this.SwitchParserRequest = (InitialPacketParser.NoParamDelegate) null;
24-
}
21+
public void Dispose()
22+
{
23+
this.SwitchParserRequest = (InitialPacketParser.NoParamDelegate)null;
24+
}
2525

26-
public object Clone()
27-
{
28-
return new InitialPacketParser();
29-
}
26+
public object Clone()
27+
{
28+
return new InitialPacketParser();
29+
}
3030

31-
public delegate void NoParamDelegate();
32-
}
31+
public delegate void NoParamDelegate();
32+
}
3333
}

Communication/PacketParser/WebPacketParser.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using SharedPacketLib;
2-
using System;
3-
using System.IO;
4-
using Akiled.Communication.Packets.Incoming;
1+
using Akiled.Communication.Packets.Incoming;
52
using Akiled.Communication.WebSocket;
6-
using System.Text;
7-
using System.Security.Cryptography;
83
using Akiled.HabboHotel.WebClients;
94
using Akiled.Utilities;
5+
using SharedPacketLib;
6+
using System;
7+
using System.IO;
8+
using System.Security.Cryptography;
9+
using System.Text;
1010

1111
namespace Akiled.Net
1212
{
@@ -29,7 +29,7 @@ public void handlePacketData(byte[] Data, bool deciphered = false)
2929
if (onNewPacket == null)
3030
return;
3131

32-
if(Data[0] == 71 && Data[1] == 69)
32+
if (Data[0] == 71 && Data[1] == 69)
3333
{
3434
PolicyRequest(Data);
3535
return;
@@ -51,7 +51,7 @@ public void handlePacketData(byte[] Data, bool deciphered = false)
5151
int MsgLen = HabboEncoding.DecodeInt32(Reader.ReadBytes(4));
5252

5353
if ((Reader.BaseStream.Length) < MsgLen) return;
54-
54+
5555
if (MsgLen < 0 || MsgLen > 5120) return;
5656

5757
byte[] Packet = Reader.ReadBytes(MsgLen);

Communication/Packets/Incoming/Catalog/PurchaseFromCatalogAsGiftEvent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void Parse(GameClient Session, ClientPacket Packet)
6363

6464
if (Session.GetHabbo().SessionGiftBlocked) return;
6565

66-
string ED = Session.GetHabbo().Id + ";" + GiftMessage + Convert.ToChar(5) + Ribbon + Convert.ToChar(5) + Colour;
66+
string ED = Session.GetHabbo().Id + ";" + GiftMessage + Convert.ToChar(5) + Ribbon + Convert.ToChar(5) + Colour;
6767

6868
int NewItemId = 0;
6969
using (IQueryAdapter dbClient = AkiledEnvironment.GetDatabaseManager().GetQueryReactor())
@@ -90,7 +90,7 @@ public void Parse(GameClient Session, ClientPacket Packet)
9090
if (Groupid == 0)
9191
return;
9292
Group groupItem;
93-
if(AkiledEnvironment.GetGame().GetGroupManager().TryGetGroup(Groupid, out groupItem))
93+
if (AkiledEnvironment.GetGame().GetGroupManager().TryGetGroup(Groupid, out groupItem))
9494
ItemExtraData = "0;" + groupItem.Id;
9595
break;
9696

Communication/Packets/Incoming/Catalog/PurchaseFromCatalogEvent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public void Parse(GameClient Session, ClientPacket Packet)
422422
if (catalogItem.Data.InteractionType == InteractionType.PREFIX_COLORNAME)
423423
{
424424
string str2 = Session.GetHabbo().Prefixnamecolor.Split(';')[1];
425-
Session.GetHabbo().Prefixnamecolor = string.IsNullOrEmpty(str2) ? catalogItem.Data.ItemName + ";": catalogItem.Data.ItemName + ";" + str2;
425+
Session.GetHabbo().Prefixnamecolor = string.IsNullOrEmpty(str2) ? catalogItem.Data.ItemName + ";" : catalogItem.Data.ItemName + ";" + str2;
426426
using (IQueryAdapter queryReactor = AkiledEnvironment.GetDatabaseManager().GetQueryReactor())
427427
{
428428
queryReactor.SetQuery("UPDATE `users` SET `prefixnamecolor` = @prefixnamecolor WHERE `id` = '" + Session.GetHabbo().Id.ToString() + "' LIMIT 1");
@@ -435,7 +435,7 @@ public void Parse(GameClient Session, ClientPacket Packet)
435435
Session.SendPacket((IServerPacket)new FurniListUpdateComposer());
436436
flag2 = true;
437437
}
438-
438+
439439
if (catalogItem.Data.InteractionType == InteractionType.PREFIX_SIZENAME)
440440
{
441441
string str2 = Session.GetHabbo().PrefixSize.Split(';')[0];

0 commit comments

Comments
 (0)