forked from Xeeynamo/sonic-hybrid-rsdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
sonic3air-main/Oxygen/oxygenserver/build/_vstudio/testclient.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<ClCompile Include="..\..\source\testclient\main_client.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\..\source\PrivatePackets.h"> | ||
<Filter>_shared</Filter> | ||
</ClInclude> | ||
<ClInclude Include="..\..\source\Shared.h"> | ||
<Filter>_shared</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Filter Include="_shared"> | ||
<UniqueIdentifier>{24140ba2-9c5b-415d-87ac-94b6922d665d}</UniqueIdentifier> | ||
</Filter> | ||
</ItemGroup> | ||
</Project> |
20 changes: 20 additions & 0 deletions
20
sonic3air-main/Oxygen/oxygenserver/source/PrivatePackets.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Part of the Oxygen Engine / Sonic 3 A.I.R. software distribution. | ||
* Copyright (C) 2017-2024 by Eukaryot | ||
* | ||
* Published under the GNU GPLv3 open source software license, see license.txt | ||
* or https://www.gnu.org/licenses/gpl-3.0.en.html | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "oxygen_netcore/network/RequestBase.h" | ||
|
||
|
||
// These are packets that are only used for communication between the private client and the server | ||
namespace privatepackets | ||
{ | ||
|
||
// Nothing here... | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Part of the Oxygen Engine / Sonic 3 A.I.R. software distribution. | ||
* Copyright (C) 2017-2024 by Eukaryot | ||
* | ||
* Published under the GNU GPLv3 open source software license, see license.txt | ||
* or https://www.gnu.org/licenses/gpl-3.0.en.html | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "oxygen_netcore/network/ConnectionManager.h" | ||
|
||
|
||
#if 1 | ||
static const std::string SERVER_NAME = "127.0.0.1"; | ||
#else | ||
static const std::string SERVER_NAME = "gameserver.sonic3air.org"; | ||
#endif | ||
static const uint16 UDP_SERVER_PORT = 21094; // Only used by test client, for the server see "config.json" | ||
static const uint16 TCP_SERVER_PORT = 21095; // Only used by test client, for the server see "config.json" | ||
|
||
|
||
static void setupDebugSettings(ConnectionManager::DebugSettings& debugSettings) | ||
{ | ||
#ifdef DEBUG | ||
debugSettings.mSendingPacketLoss = 0.0f; | ||
debugSettings.mReceivingPacketLoss = 0.0f; | ||
#endif | ||
} |
29 changes: 29 additions & 0 deletions
29
sonic3air-main/Oxygen/oxygenserver/source/oxygenserver/Configuration.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Part of the Oxygen Engine / Sonic 3 A.I.R. software distribution. | ||
* Copyright (C) 2017-2024 by Eukaryot | ||
* | ||
* Published under the GNU GPLv3 open source software license, see license.txt | ||
* or https://www.gnu.org/licenses/gpl-3.0.en.html | ||
*/ | ||
|
||
#include "oxygenserver/pch.h" | ||
#include "oxygenserver/Configuration.h" | ||
|
||
|
||
Configuration::Configuration() | ||
{ | ||
mSingleInstance = this; | ||
} | ||
|
||
bool Configuration::loadConfiguration(const std::wstring& filename) | ||
{ | ||
// Open file | ||
const Json::Value root = rmx::JsonHelper::loadFile(filename); | ||
if (root.isNull()) | ||
return false; | ||
rmx::JsonHelper rootHelper(root); | ||
|
||
rootHelper.tryReadAsInt("UDPPort", mUDPPort); | ||
rootHelper.tryReadAsInt("TCPPort", mTCPPort); | ||
return true; | ||
} |