Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
CCIGAMES committed Mar 2, 2024
1 parent 8c6842b commit 856e663
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
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 sonic3air-main/Oxygen/oxygenserver/source/PrivatePackets.h
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...

}
29 changes: 29 additions & 0 deletions sonic3air-main/Oxygen/oxygenserver/source/Shared.h
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
}
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;
}

0 comments on commit 856e663

Please sign in to comment.