Skip to content

Commit

Permalink
Moving configuration & figuredata to a config folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sledmore committed Dec 18, 2017
1 parent 87782d4 commit 7f9c1a6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
27 changes: 27 additions & 0 deletions Config/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## MySQL Configuration
db.hostname=127.0.0.1
db.port=3306
db.username=root
db.password=password
db.name=plus

## MySQL pooling setup (controls amount of connections)
db.pool.minsize=5
db.pool.maxsize=65

## Game TCP/IP Configuration
game.tcp.bindip=127.0.0.1
game.tcp.port=1232
game.tcp.conlimit=100000
game.tcp.conperip=50000
game.tcp.enablenagles=true

## MUS TCP/IP Configuration
rcon.tcp.bindip=127.0.0.1
rcon.tcp.port=30001
rcon.tcp.allowedaddr=localhost;127.0.0.1

## Client configuration
client.ping.enabled=1
client.ping.interval=30000
client.maxrequests=300
2 changes: 2 additions & 0 deletions Config/figuredata.xml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Core/FigureData/FigureDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Xml;
using Plus.HabboHotel.Catalog.Clothing;
using Plus.HabboHotel.Users.Clothing.Parts;
using System.IO;

namespace Plus.Core.FigureData
{
Expand Down Expand Up @@ -38,8 +39,11 @@ public void Init()
if (this._setTypes.Count > 0)
this._setTypes.Clear();


string projectSolutionPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));

XmlDocument xDoc = new XmlDocument();
xDoc.Load(@"extra/figuredata.xml");
xDoc.Load(projectSolutionPath + "\\Config\\figuredata.xml");

XmlNodeList Colors = xDoc.GetElementsByTagName("colors");
foreach (XmlNode Node in Colors)
Expand Down
2 changes: 2 additions & 0 deletions Plus Emulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,14 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="Config\figuredata.xml" />
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="Config\config.ini" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
Expand Down
6 changes: 4 additions & 2 deletions PlusEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public static void Initialize()

try
{
_configuration = new ConfigurationData(Path.Combine(Application.StartupPath, @"config.ini"));
string projectSolutionPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));

_configuration = new ConfigurationData(projectSolutionPath + "\\Config\\config.ini");

var connectionString = new MySqlConnectionStringBuilder
{
Expand Down Expand Up @@ -146,7 +148,7 @@ public static void Initialize()
HabboEncryptionV2.Initialize(new RSAKeys());

//Make sure Rcon is connected before we allow clients to connect.
_Rcon = new RconSocket(GetConfig().data["Rcon.tcp.bindip"], int.Parse(GetConfig().data["Rcon.tcp.port"]), GetConfig().data["Rcon.tcp.allowedaddr"].Split(Convert.ToChar(";")));
_Rcon = new RconSocket(GetConfig().data["rcon.tcp.bindip"], int.Parse(GetConfig().data["rcon.tcp.port"]), GetConfig().data["rcon.tcp.allowedaddr"].Split(Convert.ToChar(";")));

//Accept connections.
_connectionManager = new ConnectionHandling(int.Parse(GetConfig().data["game.tcp.port"]), int.Parse(GetConfig().data["game.tcp.conlimit"]), int.Parse(GetConfig().data["game.tcp.conperip"]), GetConfig().data["game.tcp.enablenagles"].ToLower() == "true");
Expand Down

0 comments on commit 7f9c1a6

Please sign in to comment.