Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

restructure files into rts/Net/ & rts/Game/Players/

move all netcode & server/client related code (from Game/ & System) to rts/Net/*
move some player structures from Game/ to Game/Players/
  • Loading branch information...
commit 2fafeb7c3166349e14c7d1efbcfc65e3bec5a9f5 1 parent 471549a
jK authored
Showing with 234 additions and 230 deletions.
  1. +3 −1 directories.txt
  2. +2 −0  rts/CMakeLists.txt
  3. +3 −3 rts/ExternalAI/AICallback.cpp
  4. +1 −1  rts/ExternalAI/AICheats.cpp
  5. +3 −3 rts/ExternalAI/EngineOutHandler.cpp
  6. +1 −1  rts/ExternalAI/SkirmishAIBase.h
  7. +1 −1  rts/ExternalAI/SkirmishAIHandler.cpp
  8. +8 −19 rts/Game/CMakeLists.txt
  9. +1 −1  rts/Game/ChatMessage.cpp
  10. +1 −1  rts/Game/CommandMessage.cpp
  11. +1 −1  rts/Game/FPSUnitController.cpp
  12. +2 −2 rts/Game/{ → GUI}/PlayerRoster.cpp
  13. 0  rts/Game/{ → GUI}/PlayerRoster.h
  14. +3 −3 rts/Game/{ → GUI}/PlayerRosterDrawer.cpp
  15. 0  rts/Game/{ → GUI}/PlayerRosterDrawer.h
  16. +6 −6 rts/Game/Game.cpp
  17. +1 −1  rts/Game/GameData.cpp
  18. +1 −1  rts/Game/GameSetup.h
  19. +2 −2 rts/Game/GlobalUnsynced.cpp
  20. +4 −4 rts/Game/InMapDraw.cpp
  21. +4 −4 rts/Game/InMapDrawModel.cpp
  22. +4 −4 rts/Game/LoadScreen.cpp
  23. +2 −2 rts/Game/{ → Players}/Player.cpp
  24. +1 −1  rts/Game/{ → Players}/Player.h
  25. 0  rts/Game/{ → Players}/PlayerBase.cpp
  26. +1 −1  rts/Game/{ → Players}/PlayerBase.h
  27. +2 −2 rts/Game/{ → Players}/PlayerHandler.cpp
  28. 0  rts/Game/{ → Players}/PlayerHandler.h
  29. 0  rts/Game/{ → Players}/PlayerStatistics.cpp
  30. 0  rts/Game/{ → Players}/PlayerStatistics.h
  31. 0  rts/Game/{ → Players}/TeamController.cpp
  32. 0  rts/Game/{ → Players}/TeamController.h
  33. +5 −5 rts/Game/PreGame.cpp
  34. +3 −3 rts/Game/SelectedUnitsAI.cpp
  35. +3 −3 rts/Game/SelectedUnitsHandler.cpp
  36. +3 −3 rts/Game/SyncedGameCommands.cpp
  37. +2 −2 rts/Game/UI/EndGameBox.cpp
  38. +4 −4 rts/Game/UI/GameSetupDrawer.cpp
  39. +1 −1  rts/Game/UI/MiniMap.cpp
  40. +2 −2 rts/Game/UI/MouseHandler.cpp
  41. +3 −3 rts/Game/UI/QuitBox.cpp
  42. +1 −1  rts/Game/UI/ResourceBar.cpp
  43. +4 −4 rts/Game/UI/ShareBox.cpp
  44. +1 −1  rts/Game/UI/StartPosSelecter.cpp
  45. +1 −1  rts/Game/UI/TooltipConsole.cpp
  46. +5 −5 rts/Game/UnsyncedGameCommands.cpp
  47. +3 −3 rts/Lua/LuaHandle.cpp
  48. +19 −1 rts/Lua/LuaOpenGLUtils.cpp
  49. +2 −2 rts/Lua/LuaSyncedCtrl.cpp
  50. +2 −2 rts/Lua/LuaSyncedRead.cpp
  51. +0 −1  rts/Lua/LuaUI.cpp
  52. +3 −3 rts/Lua/LuaUnsyncedCtrl.cpp
  53. +5 −5 rts/Lua/LuaUnsyncedRead.cpp
  54. +1 −1  rts/{System → Net}/AutohostInterface.cpp
  55. 0  rts/{System → Net}/AutohostInterface.h
  56. +16 −0 rts/Net/CMakeLists.txt
  57. +1 −1  rts/{Game/Server → Net}/GameParticipant.cpp
  58. +2 −2 rts/{Game/Server → Net}/GameParticipant.h
  59. +17 −17 rts/{Game → Net}/GameServer.cpp
  60. +1 −1  rts/{Game → Net}/GameServer.h
  61. 0  rts/{Game/Server → Net}/GameSkirmishAI.h
  62. +17 −32 rts/{Game → Net}/NetCommands.cpp
  63. +2 −2 rts/{System → Net/Protocol}/BaseNetProtocol.cpp
  64. 0  rts/{System → Net/Protocol}/BaseNetProtocol.h
  65. +1 −1  rts/{System → Net/Protocol}/NetProtocol.cpp
  66. +1 −1  rts/{System → Net/Protocol}/NetProtocol.h
  67. +2 −2 rts/Rendering/HUDDrawer.cpp
  68. +2 −2 rts/Rendering/TeamHighlight.cpp
  69. +1 −1  rts/Rendering/UnitDrawer.cpp
  70. +3 −3 rts/Sim/Misc/Team.cpp
  71. +2 −2 rts/Sim/MoveTypes/ClassicGroundMoveType.cpp
  72. +1 −1  rts/Sim/MoveTypes/GroundMoveType.cpp
  73. +1 −1  rts/Sim/MoveTypes/HoverAirMoveType.cpp
  74. +1 −1  rts/Sim/MoveTypes/StrafeAirMoveType.cpp
  75. +1 −1  rts/Sim/Path/Default/PathEstimator.cpp
  76. +1 −1  rts/Sim/Units/Unit.cpp
  77. +1 −1  rts/Sim/Weapons/Weapon.cpp
  78. +0 −3  rts/System/CMakeLists.txt
  79. +1 −1  rts/System/LoadSave/CregLoadSaveHandler.cpp
  80. +2 −2 rts/System/LoadSave/DemoReader.h
  81. +2 −2 rts/System/LoadSave/DemoRecorder.h
  82. +1 −1  rts/System/Net/LocalConnection.cpp
  83. +3 −3 rts/System/Net/UDPConnection.cpp
  84. +1 −1  rts/System/Platform/Win/CrashHandler.cpp
  85. +3 −3 rts/System/Platform/errorhandler.cpp
  86. +2 −2 rts/System/SpringApp.cpp
  87. +1 −2  rts/System/Sync/DumpState.cpp
  88. +3 −4 rts/System/Sync/SyncDebugger.cpp
  89. +4 −6 rts/builds/dedicated/CMakeLists.txt
  90. +1 −1  rts/builds/dedicated/main.cpp
  91. +1 −1  test/CMakeLists.txt
  92. +1 −1  tools/DemoTool/CMakeLists.txt
  93. +2 −2 tools/DemoTool/DemoTool.cpp
  94. +1 −1  tools/DemoTool/StringSerializer.h
View
4 directories.txt
@@ -13,9 +13,10 @@ rts/ExternalAI engine side AI interface
rts/ExternalAI/Interface AI side AI interface (also used by the engine)
rts/Game General game code
rts/Game/Camera different camera implementations
-rts/Game/Server server part of the game (communication heart of all engine builds)
+rts/Game/Players Player related structs
rts/Game/StartScripts Hardcoded startscripts
rts/Game/UI Game controls including current gui
+rts/Game/GUI pure GUI `widgets`
rts/lib Third party libraries
rts/lib/7z 7zip library
rts/lib/assimp Open Asset Import Library (short name: Assimp)
@@ -34,6 +35,7 @@ rts/Map Map loading & rendering
rts/Map/SM3 SM3 map support
rts/Map/SMF SMF map support
rts/Menu Menu shown when the engine executable is launched without parameters
+rts/Net netcode, game server & net client
rts/aGui engine internal, OpenGL based simple GUI framework
rts/Rendering
rts/Rendering/Env Sky(box), trees, water, grass
View
2  rts/CMakeLists.txt
@@ -94,11 +94,13 @@ Add_Subdirectory(Rendering)
Add_Subdirectory(aGui)
Add_Subdirectory(Menu)
Add_Subdirectory(Map)
+Add_Subdirectory(Net)
Add_Subdirectory(Sim)
#Add_Subdirectory(System) # this is already added in ../
SET(engineSources
${sources_engine_Game}
+ ${sources_engine_Net}
${sources_engine_Lua}
${sources_engine_Map}
${sources_engine_Rendering}
View
6 rts/ExternalAI/AICallback.cpp
@@ -10,8 +10,8 @@
#include "Game/GlobalUnsynced.h"
#include "Game/TraceRay.h"
#include "Game/GameSetup.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/SelectedUnitsHandler.h"
#include "Game/InMapDraw.h"
#include "Game/UI/MiniMap.h"
@@ -52,7 +52,7 @@
#include "ExternalAI/EngineOutHandler.h"
#include "System/EventHandler.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/FileSystem/FileHandler.h"
#include "System/FileSystem/DataDirsAccess.h"
#include "System/FileSystem/FileSystem.h"
View
2  rts/ExternalAI/AICheats.cpp
@@ -13,7 +13,7 @@
#include "Sim/Features/Feature.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/TeamHandler.h"
-#include "Game/GameServer.h"
+#include "Net/GameServer.h"
#include "Game/GameSetup.h"
#include "System/myMath.h"
View
6 rts/ExternalAI/EngineOutHandler.cpp
@@ -11,14 +11,14 @@
#include "Sim/Misc/GlobalSynced.h"
#include "Game/GameHelper.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Sim/Units/Unit.h"
#include "Sim/Units/UnitHandler.h"
#include "Sim/Misc/Team.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Weapons/WeaponDef.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Config/ConfigHandler.h"
#include "System/Log/ILog.h"
#include "System/Util.h"
View
2  rts/ExternalAI/SkirmishAIBase.h
@@ -3,7 +3,7 @@
#ifndef SKIRMISH_AI_BASE_H
#define SKIRMISH_AI_BASE_H
-#include "Game/TeamController.h"
+#include "Game/Players/TeamController.h"
#include "System/creg/creg_cond.h"
#include <string>
View
2  rts/ExternalAI/SkirmishAIHandler.cpp
@@ -9,7 +9,7 @@
#include "ExternalAI/Interface/SSkirmishAILibrary.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Option.h"
#include "System/creg/STL_Map.h"
View
27 rts/Game/CMakeLists.txt
@@ -1,7 +1,7 @@
# This list was created using this *nix shell command:
# > find . -name "*.cpp" | sort
-SET(sources_engine_Game_common
+SET(sources_engine_Game
"${CMAKE_CURRENT_SOURCE_DIR}/Action.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/AviVideoCapturing.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Benchmark.cpp"
@@ -27,28 +27,26 @@ SET(sources_engine_Game_common
"${CMAKE_CURRENT_SOURCE_DIR}/GameController.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameData.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameHelper.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/GameServer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameSetup.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GameVersion.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/GlobalUnsynced.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/GUI/PlayerRoster.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/GUI/PlayerRosterDrawer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/IVideoCapturing.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/InMapDraw.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/InMapDrawModel.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/LoadScreen.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Messages.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/NetCommands.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/Player.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/PlayerBase.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/PlayerHandler.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/PlayerRoster.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/PlayerRosterDrawer.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/PlayerStatistics.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Players/Player.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Players/PlayerBase.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Players/PlayerHandler.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Players/PlayerStatistics.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Players/TeamController.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/PreGame.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SelectedUnitsHandler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SelectedUnitsAI.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/SyncedGameCommands.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TraceRay.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/TeamController.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UI/CommandColors.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UI/CursorIcons.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UI/EndGameBox.cpp"
@@ -77,14 +75,5 @@ SET(sources_engine_Game_common
"${CMAKE_CURRENT_SOURCE_DIR}/WaitCommandsAI.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/WordCompletion.cpp"
)
-SET(sources_engine_Game_Server
- "${CMAKE_CURRENT_SOURCE_DIR}/Server/GameParticipant.cpp"
- )
-SET(sources_engine_Game
- ${sources_engine_Game_common}
- ${sources_engine_Game_Server}
- )
-MakeGlobal(sources_engine_Game_common)
-MakeGlobal(sources_engine_Game_Server)
MakeGlobal(sources_engine_Game)
View
2  rts/Game/ChatMessage.cpp
@@ -3,7 +3,7 @@
#include "ChatMessage.h"
-#include "System/BaseNetProtocol.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/Net/PackPacket.h"
#include "System/Net/UnpackPacket.h"
View
2  rts/Game/CommandMessage.cpp
@@ -5,7 +5,7 @@
#include "CommandMessage.h"
-#include "System/BaseNetProtocol.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/Net/PackPacket.h"
#include "System/Net/UnpackPacket.h"
View
2  rts/Game/FPSUnitController.cpp
@@ -12,7 +12,7 @@
#include "Sim/Units/Scripts/CobInstance.h"
#include "Sim/Weapons/Weapon.h"
#include "System/myMath.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include <SDL_mouse.h>
View
4 rts/Game/PlayerRoster.cpp → rts/Game/GUI/PlayerRoster.cpp
@@ -2,8 +2,8 @@
#include "PlayerRoster.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/GlobalUnsynced.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Misc/GlobalSynced.h"
View
0  rts/Game/PlayerRoster.h → rts/Game/GUI/PlayerRoster.h
File renamed without changes
View
6 rts/Game/PlayerRosterDrawer.cpp → rts/Game/GUI/PlayerRosterDrawer.cpp
@@ -3,11 +3,11 @@
#include "PlayerRosterDrawer.h"
-#include "GlobalUnsynced.h"
-#include "Player.h"
-#include "PlayerHandler.h"
#include "PlayerRoster.h"
+#include "Game/GlobalUnsynced.h"
#include "Game/UI/GuiHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Rendering/glFont.h"
#include "Rendering/GlobalRendering.h"
#include "Sim/Misc/GlobalConstants.h"
View
0  rts/Game/PlayerRosterDrawer.h → rts/Game/GUI/PlayerRosterDrawer.h
File renamed without changes
View
12 rts/Game/Game.cpp
@@ -21,16 +21,11 @@
#include "CommandMessage.h"
#include "ConsoleHistory.h"
#include "GameHelper.h"
-#include "GameServer.h"
#include "GameVersion.h"
#include "GameSetup.h"
#include "GlobalUnsynced.h"
#include "LoadScreen.h"
#include "SelectedUnitsHandler.h"
-#include "Player.h"
-#include "PlayerHandler.h"
-#include "PlayerRoster.h"
-#include "PlayerRosterDrawer.h"
#include "WaitCommandsAI.h"
#include "WordCompletion.h"
#include "IVideoCapturing.h"
@@ -40,6 +35,11 @@
#include "SyncedGameCommands.h"
#include "UnsyncedActionExecutor.h"
#include "UnsyncedGameCommands.h"
+#include "Game/GUI/PlayerRoster.h"
+#include "Game/GUI/PlayerRosterDrawer.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
#include "Game/UI/UnitTracker.h"
#include "ExternalAI/EngineOutHandler.h"
#include "ExternalAI/IAILibraryManager.h"
@@ -135,7 +135,7 @@
#include "System/Sync/FPUCheck.h"
#include "System/GlobalConfig.h"
#include "System/myMath.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/SpringApp.h"
#include "System/Util.h"
#include "System/Input/KeyInput.h"
View
2  rts/Game/GameData.cpp
@@ -5,7 +5,7 @@
#include "GameData.h"
-#include "System/BaseNetProtocol.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/Net/PackPacket.h"
#include "System/Net/UnpackPacket.h"
View
2  rts/Game/GameSetup.h
@@ -8,7 +8,7 @@
#include <vector>
#include <set>
-#include "PlayerBase.h"
+#include "Players/PlayerBase.h"
#include "Sim/Misc/TeamBase.h"
#include "Sim/Misc/AllyTeam.h"
#include "ExternalAI/SkirmishAIData.h"
View
4 rts/Game/GlobalUnsynced.cpp
@@ -7,8 +7,8 @@
#include "GlobalUnsynced.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Misc/GlobalConstants.h" // for RANDINT_MAX
#include "Sim/Units/Unit.h" // required by CREG
View
8 rts/Game/InMapDraw.cpp
@@ -9,8 +9,9 @@
#include "Camera.h"
#include "Game.h"
#include "GlobalUnsynced.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "UI/MiniMap.h"
#include "UI/MouseHandler.h"
#include "ExternalAI/AILegacySupport.h" // {Point, Line}Marker
@@ -20,8 +21,7 @@
#include "Sim/Misc/TeamHandler.h"
#include "System/EventHandler.h"
#include "System/EventClient.h"
-#include "System/BaseNetProtocol.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Log/ILog.h"
#include "System/Sound/ISound.h"
#include "System/Sound/SoundChannels.h"
View
8 rts/Game/InMapDrawModel.cpp
@@ -2,14 +2,14 @@
#include "InMapDrawModel.h"
-#include "Player.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/PlayerHandler.h"
-#include "Game/TeamController.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Game/Players/TeamController.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "Map/Ground.h"
#include "Sim/Misc/TeamHandler.h"
#include "System/EventHandler.h"
-#include "System/BaseNetProtocol.h"
#include "System/creg/STL_List.h"
#include "lib/gml/gmlmut.h"
View
8 rts/Game/LoadScreen.cpp
@@ -7,8 +7,8 @@
#include "Game.h"
#include "GameVersion.h"
#include "GlobalUnsynced.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/UI/MouseHandler.h"
#include "Game/UI/InputReceiver.h"
#include "ExternalAI/SkirmishAIHandler.h"
@@ -24,7 +24,7 @@
#include "System/Exceptions.h"
#include "System/Sync/FPUCheck.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/FileSystem/FileHandler.h"
#include "System/Platform/Watchdog.h"
#include "System/Sound/ISound.h"
@@ -140,7 +140,7 @@ CLoadScreen::~CLoadScreen()
if (!gu->globalQuit)
activeController = game;
-
+
if (activeController == this)
activeController = NULL;
View
4 rts/Game/Player.cpp → rts/Game/Players/Player.cpp
@@ -4,8 +4,8 @@
#include "ExternalAI/SkirmishAIHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Player.h"
+#include "PlayerHandler.h"
#include "Game/Camera.h"
#include "Game/CameraHandler.h"
#include "Game/GlobalUnsynced.h"
View
2  rts/Game/Player.h → rts/Game/Players/Player.h
@@ -5,7 +5,7 @@
#include "PlayerBase.h"
#include "PlayerStatistics.h"
-#include "FPSUnitController.h"
+#include "Game/FPSUnitController.h"
#include "System/creg/creg_cond.h"
#include <string>
View
0  rts/Game/PlayerBase.cpp → rts/Game/Players/PlayerBase.cpp
File renamed without changes
View
2  rts/Game/PlayerBase.h → rts/Game/Players/PlayerBase.h
@@ -3,7 +3,7 @@
#ifndef PLAYER_BASE_H
#define PLAYER_BASE_H
-#include "Game/TeamController.h"
+#include "Game/Players/TeamController.h"
#include "System/creg/creg_cond.h"
#include <string>
View
4 rts/Game/PlayerHandler.cpp → rts/Game/Players/PlayerHandler.cpp
@@ -8,7 +8,7 @@
#include "lib/gml/gmlmut.h"
#include "Sim/Misc/GlobalConstants.h"
#include "Game/GameSetup.h"
-#include "SelectedUnitsHandler.h"
+#include "Game/SelectedUnitsHandler.h"
CR_BIND(CPlayerHandler,);
@@ -38,7 +38,7 @@ void CPlayerHandler::LoadFromSetup(const CGameSetup* setup)
{
int oldSize = players.size();
int newSize = std::max( players.size(), setup->playerStartingData.size() );
-
+
for (unsigned int i = oldSize; i < newSize; ++i) {
players.push_back(new CPlayer());
}
View
0  rts/Game/PlayerHandler.h → rts/Game/Players/PlayerHandler.h
File renamed without changes
View
0  rts/Game/PlayerStatistics.cpp → rts/Game/Players/PlayerStatistics.cpp
File renamed without changes
View
0  rts/Game/PlayerStatistics.h → rts/Game/Players/PlayerStatistics.h
File renamed without changes
View
0  rts/Game/TeamController.cpp → rts/Game/Players/TeamController.cpp
File renamed without changes
View
0  rts/Game/TeamController.h → rts/Game/Players/TeamController.h
File renamed without changes
View
10 rts/Game/PreGame.cpp
@@ -11,13 +11,13 @@
#include "System/Sync/FPUCheck.h"
#include "Game.h"
#include "GameData.h"
-#include "GameServer.h"
#include "GameSetup.h"
#include "GameVersion.h"
#include "GlobalUnsynced.h"
#include "LoadScreen.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
#include "System/TimeProfiler.h"
#include "UI/InfoConsole.h"
#include "Map/Generation/SimpleMapGenerator.h"
@@ -31,7 +31,7 @@
#include "Sim/Misc/TeamHandler.h"
#include "System/Config/ConfigHandler.h"
#include "System/Exceptions.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/TdfParser.h"
#include "System/Input/KeyInput.h"
#include "System/FileSystem/ArchiveScanner.h"
@@ -229,7 +229,7 @@ void CPreGame::UpdateClientNet()
if (packet->length <= 0) {
LOG_L(L_WARNING, "[CPreGame::%s] zero-length packet (header: %i)", __FUNCTION__, inbuf[0]);
continue;
- }
+ }
switch (inbuf[0]) {
case NETMSG_QUIT: {
View
6 rts/Game/SelectedUnitsAI.cpp
@@ -4,9 +4,9 @@
#include "SelectedUnitsHandler.h"
#include "GlobalUnsynced.h"
-#include "Player.h"
-#include "PlayerHandler.h"
#include "WaitCommandsAI.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Map/Ground.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/QuadField.h"
@@ -16,7 +16,7 @@
#include "Sim/Units/CommandAI/CommandAI.h"
#include "Sim/Units/Unit.h"
#include "Sim/Units/UnitDef.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
const int CMDPARAM_MOVE_X = 0;
const int CMDPARAM_MOVE_Y = 1;
View
6 rts/Game/SelectedUnitsHandler.cpp
@@ -5,8 +5,8 @@
#include "Camera.h"
#include "GlobalUnsynced.h"
#include "WaitCommandsAI.h"
-#include "Player.h"
-#include "PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "UI/CommandColors.h"
#include "UI/GuiHandler.h"
#include "UI/TooltipConsole.h"
@@ -32,7 +32,7 @@
#include "System/EventHandler.h"
#include "System/Log/ILog.h"
#include "System/Util.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Net/PackPacket.h"
#include "System/Input/KeyInput.h"
#include "System/Sound/ISound.h"
View
6 rts/Game/SyncedGameCommands.cpp
@@ -6,14 +6,14 @@
#include "Game.h"
#include "GlobalUnsynced.h"
#include "InMapDraw.h"
-#include "Player.h"
-#include "PlayerHandler.h"
#include "SelectedUnitsHandler.h"
#include "SyncedActionExecutor.h"
#ifdef _WIN32
# include "winerror.h" // TODO someone on windows (MinGW? VS?) please check if this is required
#endif
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Lua/LuaGaia.h"
#include "Lua/LuaRules.h"
#include "Lua/LuaUI.h"
@@ -493,7 +493,7 @@ class SkipActionExecutor : public ISyncedActionExecutor {
void SyncedGameCommands::AddDefaultActionExecutors() {
-
+
AddActionExecutor(new CheatActionExecutor());
AddActionExecutor(new NoHelpActionExecutor());
AddActionExecutor(new NoSpecDrawActionExecutor());
View
4 rts/Game/UI/EndGameBox.cpp
@@ -3,11 +3,11 @@
#include "EndGameBox.h"
#include "MouseHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
#include "Game/Game.h"
#include "Game/GlobalUnsynced.h"
#include "Game/SelectedUnitsHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Rendering/glFont.h"
#include "Rendering/GL/VertexArray.h"
#include "Sim/Misc/GlobalSynced.h"
View
8 rts/Game/UI/GameSetupDrawer.cpp
@@ -4,16 +4,16 @@
#include "KeyBindings.h"
#include "StartPosSelecter.h"
-#include "Game/GameServer.h"
#include "Game/CameraHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/TeamHandler.h"
#include "Rendering/glFont.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Config/ConfigHandler.h"
#include "System/EventHandler.h"
View
2  rts/Game/UI/MiniMap.cpp
@@ -18,8 +18,8 @@
#include "Game/CameraHandler.h"
#include "Game/GameHelper.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
#include "Game/SelectedUnitsHandler.h"
+#include "Game/Players/Player.h"
#include "Game/UI/UnitTracker.h"
#include "Sim/Misc/TeamHandler.h"
#include "Lua/LuaUI.h" // FIXME: for GML
View
4 rts/Game/UI/MouseHandler.cpp
@@ -13,11 +13,11 @@
#include "Game/Game.h"
#include "Game/GlobalUnsynced.h"
#include "Game/InMapDraw.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
#include "Game/SelectedUnitsHandler.h"
#include "Game/TraceRay.h"
#include "Game/Camera/CameraController.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/UI/UnitTracker.h"
#include "Lua/LuaInputReceiver.h"
#include "Lua/LuaUI.h" // FIXME: for GML
View
6 rts/Game/UI/QuitBox.cpp
@@ -3,17 +3,17 @@
#include "QuitBox.h"
#include "MouseHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Rendering/glFont.h"
#include "Rendering/GL/myGL.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/ModInfo.h"
#include "Sim/Misc/TeamHandler.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/TimeUtil.h"
#include "System/FileSystem/FileSystem.h"
#include "System/LoadSave/LoadSaveHandler.h"
View
2  rts/Game/UI/ResourceBar.cpp
@@ -9,7 +9,7 @@
#include "Rendering/glFont.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Misc/GlobalSynced.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/TimeProfiler.h"
CResourceBar* resourceBar = NULL;
View
8 rts/Game/UI/ShareBox.cpp
@@ -5,13 +5,13 @@
#include "MouseHandler.h"
#include "Game/GlobalUnsynced.h"
#include "Game/SelectedUnitsHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Rendering/glFont.h"
#include "Rendering/GL/myGL.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/TeamHandler.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/MsgStrings.h"
#include <SDL_keysym.h>
@@ -165,7 +165,7 @@ void CShareBox::Draw()
} else {
glColor4f(0.2f, 0.2f, 0.2f, alpha);
}
-
+
DrawBox(box + unitBox);
glColor4f(0.8f, 0.8f, 0.9f, 0.7f);
View
2  rts/Game/UI/StartPosSelecter.cpp
@@ -11,7 +11,7 @@
#include "Rendering/GL/myGL.h"
#include "Rendering/glFont.h"
#include "Sim/Misc/Team.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
CStartPosSelecter* CStartPosSelecter::selector = NULL;
View
2  rts/Game/UI/TooltipConsole.cpp
@@ -4,7 +4,7 @@
#include "TooltipConsole.h"
#include "MouseHandler.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/PlayerHandler.h"
#include "Map/Ground.h"
#include "Map/MapDamage.h"
#include "Map/MapInfo.h"
View
10 rts/Game/UnsyncedGameCommands.cpp
@@ -10,14 +10,10 @@
#include "Action.h"
#include "CameraHandler.h"
#include "ConsoleHistory.h"
-#include "GameServer.h"
#include "CommandMessage.h"
#include "GameSetup.h"
#include "GlobalUnsynced.h"
#include "SelectedUnitsHandler.h"
-#include "Player.h"
-#include "PlayerHandler.h"
-#include "PlayerRoster.h"
#include "System/TimeProfiler.h"
#include "IVideoCapturing.h"
#include "WordCompletion.h"
@@ -28,6 +24,10 @@
#endif
#include "ExternalAI/IAILibraryManager.h"
#include "ExternalAI/SkirmishAIHandler.h"
+#include "Game/GUI/PlayerRoster.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
#include "Map/BaseGroundDrawer.h"
#include "Map/MetalMap.h"
#include "Map/ReadMap.h"
@@ -74,7 +74,7 @@
#include "System/EventHandler.h"
#include "System/Log/ILog.h"
#include "System/GlobalConfig.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Input/KeyInput.h"
#include "System/FileSystem/SimpleParser.h"
#include "System/Sound/ISound.h"
View
6 rts/Lua/LuaHandle.cpp
@@ -13,8 +13,9 @@
#include "LuaUtils.h"
#include "LuaZip.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/Protocol/BaseNetProtocol.h" // FIXME: for MAPDRAW_*
#include "Game/UI/KeyCodes.h"
#include "Game/UI/KeySet.h"
#include "Game/UI/KeyBindings.h"
@@ -29,7 +30,6 @@
#include "Sim/Units/UnitDef.h"
#include "Sim/Weapons/Weapon.h"
#include "Sim/Weapons/WeaponDef.h"
-#include "System/BaseNetProtocol.h" // FIXME: for MAPDRAW_*
#include "System/Config/ConfigHandler.h"
#include "System/EventHandler.h"
#include "System/GlobalConfig.h"
View
20 rts/Lua/LuaOpenGLUtils.cpp
@@ -4,10 +4,28 @@
#include <boost/assign/list_of.hpp>
#include "LuaOpenGLUtils.h"
+
+#include "LuaHandle.h"
+#include "LuaTextures.h"
#include "Game/Camera.h"
+#include "Map/BaseGroundDrawer.h"
+#include "Map/HeightMapTexture.h"
+#include "Map/ReadMap.h"
+#include "Rendering/glFont.h"
+#include "Rendering/IconHandler.h"
#include "Rendering/ShadowHandler.h"
+#include "Rendering/Env/CubeMapHandler.h"
+#include "Rendering/Models/3DModel.h"
+#include "Rendering/Textures/NamedTextures.h"
+#include "Rendering/Textures/3DOTextureHandler.h"
+#include "Rendering/Textures/S3OTextureHandler.h"
+#include "Sim/Features/FeatureDef.h"
+#include "Sim/Features/FeatureHandler.h"
+#include "Sim/Units/UnitDef.h"
+#include "Sim/Units/UnitDefHandler.h"
#include "System/Matrix44f.h"
#include "System/Util.h"
+#include "System/Log/ILOG.h"
/******************************************************************************/
@@ -34,7 +52,7 @@ static const std::map<std::string, LUAMATRICES> matrixNameToId = boost::assign::
("viewprojection", LUAMATRICES_VIEWPROJECTION)
("viewprojectioninverse", LUAMATRICES_VIEWPROJECTIONINVERSE)
("billboard", LUAMATRICES_BILLBOARD)
- //!backward compability
+ // backward compability
("camera", LUAMATRICES_VIEW)
("caminv", LUAMATRICES_VIEWINVERSE)
("camprj", LUAMATRICES_PROJECTION)
View
4 rts/Lua/LuaSyncedCtrl.cpp
@@ -16,11 +16,11 @@
#include "LuaSyncedMoveCtrl.h"
#include "LuaUtils.h"
#include "Game/Game.h"
-#include "Game/GameServer.h"
#include "Game/Camera.h"
#include "Game/GameHelper.h"
-#include "Game/PlayerHandler.h"
#include "Game/SelectedUnitsHandler.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
#include "Map/Ground.h"
#include "Map/MapDamage.h"
#include "Map/MapInfo.h"
View
4 rts/Lua/LuaSyncedRead.cpp
@@ -16,8 +16,8 @@
#include "Game/GameSetup.h"
#include "Game/Camera.h"
#include "Game/GameHelper.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Map/Ground.h"
#include "Map/MapDamage.h"
#include "Map/MapInfo.h"
View
1  rts/Lua/LuaUI.cpp
@@ -30,7 +30,6 @@
#include "Game/Game.h"
#include "Game/GameHelper.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/PlayerRoster.h"
#include "Game/SelectedUnitsHandler.h"
#include "Game/UI/CommandColors.h"
#include "Game/UI/CursorIcons.h"
View
6 rts/Lua/LuaUnsyncedCtrl.cpp
@@ -16,8 +16,8 @@
#include "Game/Game.h"
#include "Game/GlobalUnsynced.h"
#include "Game/SelectedUnitsHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/InMapDraw.h"
#include "Game/InMapDrawModel.h"
#include "Game/UI/CommandColors.h"
@@ -54,7 +54,7 @@
#include "System/EventHandler.h"
#include "System/GlobalConfig.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Net/PackPacket.h"
#include "System/Util.h"
#include "System/Sound/ISound.h"
View
10 rts/Lua/LuaUnsyncedRead.cpp
@@ -10,12 +10,12 @@
#include "Game/CameraHandler.h"
#include "Game/Game.h"
#include "Game/GameHelper.h"
-#include "Game/GameServer.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
-#include "Game/PlayerRoster.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/GameServer.h"
+#include "Game/GUI/PlayerRoster.h"
#include "Game/SelectedUnitsHandler.h"
#include "Game/TraceRay.h"
#include "Game/Camera/CameraController.h"
@@ -45,7 +45,7 @@
#include "Sim/Units/UnitTypes/TransportUnit.h"
#include "Sim/Units/Groups/Group.h"
#include "Sim/Units/Groups/GroupHandler.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/Config/ConfigVariable.h"
#include "System/Input/KeyInput.h"
#include "System/FileSystem/FileHandler.h"
View
2  rts/System/AutohostInterface.cpp → rts/Net/AutohostInterface.cpp
@@ -2,7 +2,7 @@
#include "AutohostInterface.h"
-#include "System/BaseNetProtocol.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/Log/ILog.h"
#include "System/Net/Socket.h"
View
0  rts/System/AutohostInterface.h → rts/Net/AutohostInterface.h
File renamed without changes
View
16 rts/Net/CMakeLists.txt
@@ -0,0 +1,16 @@
+
+SET(sources_engine_NetServer
+ "${CMAKE_CURRENT_SOURCE_DIR}/AutohostInterface.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/GameServer.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/GameParticipant.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Protocol/BaseNetProtocol.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Protocol/NetProtocol.cpp"
+ )
+SET(sources_engine_NetClient
+ "${CMAKE_CURRENT_SOURCE_DIR}/NetCommands.cpp"
+ )
+
+Set(sources_engine_Net ${sources_engine_NetServer} ${sources_engine_NetClient})
+
+MakeGlobal(sources_engine_NetServer)
+MakeGlobal(sources_engine_Net)
View
2  rts/Game/Server/GameParticipant.cpp → rts/Net/GameParticipant.cpp
@@ -2,9 +2,9 @@
#include "GameParticipant.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "Sim/Misc/GlobalConstants.h"
#include "System/Net/Connection.h"
-#include "System/BaseNetProtocol.h"
#include "System/Misc/SpringTime.h"
GameParticipant::GameParticipant()
View
4 rts/Game/Server/GameParticipant.h → rts/Net/GameParticipant.h
@@ -5,8 +5,8 @@
#include <boost/shared_ptr.hpp>
-#include "Game/PlayerBase.h"
-#include "Game/PlayerStatistics.h"
+#include "Game/Players/PlayerBase.h"
+#include "Game/Players/PlayerStatistics.h"
#include "System/Net/LoopbackConnection.h"
namespace netcode
View
34 rts/Game/GameServer.cpp → rts/Net/GameServer.cpp
@@ -21,29 +21,29 @@
#include "System/Net/Connection.h"
#include "GameServer.h"
-
-#include "GameSetup.h"
-#include "Action.h"
-#include "ChatMessage.h"
-#include "CommandMessage.h"
-#include "System/BaseNetProtocol.h"
-#include "PlayerHandler.h"
-#ifdef DEDICATED
- #include "System/LoadSave/DemoRecorder.h"
-#endif
-#include "System/AutohostInterface.h"
+#include "Net/Protocol/BaseNetProtocol.h"
+
+#include "GameParticipant.h"
+#include "GameSkirmishAI.h"
+#include "AutohostInterface.h"
+#include "Game/GameSetup.h"
+#include "Game/Action.h"
+#include "Game/ChatMessage.h"
+#include "Game/CommandMessage.h"
+#include "Game/GlobalUnsynced.h" // for syncdebug
#include "System/Util.h"
#include "System/TdfParser.h"
-#include "GlobalUnsynced.h" // for syncdebug
#include "Sim/Misc/GlobalConstants.h"
-#ifndef DEDICATED
+
+#ifdef DEDICATED
+ #include "System/LoadSave/DemoRecorder.h"
+#else
#include "Sim/Misc/GlobalSynced.h"
#endif
-#include "Player.h"
-#include "IVideoCapturing.h"
-#include "Server/GameParticipant.h"
-#include "Server/GameSkirmishAI.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Game/IVideoCapturing.h"
// This undef is needed, as somewhere there is a type interface specified,
// which we need not!
// (would cause problems in ExternalAI/Interface/SAIInterfaceLibrary.h)
View
2  rts/Game/GameServer.h → rts/Net/GameServer.h
@@ -11,7 +11,7 @@
#include <vector>
#include <list>
-#include "GameData.h"
+#include "Game/GameData.h"
#include "Sim/Misc/TeamBase.h"
#include "System/UnsyncedRNG.h"
#include "System/float3.h"
View
0  rts/Game/Server/GameSkirmishAI.h → rts/Net/GameSkirmishAI.h
File renamed without changes
View
49 rts/Game/NetCommands.cpp → rts/Net/NetCommands.cpp
@@ -1,34 +1,35 @@
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
-#include "Game.h"
-#include "CameraHandler.h"
+#include "Game/Game.h"
#include "GameServer.h"
-#include "CommandMessage.h"
-#include "GameSetup.h"
-#include "GlobalUnsynced.h"
-#include "SelectedUnitsHandler.h"
-#include "Player.h"
-#include "PlayerHandler.h"
-#include "ChatMessage.h"
-#include "System/TimeProfiler.h"
-#include "WordCompletion.h"
-#include "IVideoCapturing.h"
-#include "InMapDraw.h"
+
#ifdef _WIN32
# include "winerror.h" // TODO someone on windows (MinGW? VS?) please check if this is required
#endif
#include "ExternalAI/EngineOutHandler.h"
#include "ExternalAI/SkirmishAIHandler.h"
+#include "Game/CameraHandler.h"
+#include "Game/CommandMessage.h"
+#include "Game/GameSetup.h"
+#include "Game/GlobalUnsynced.h"
+#include "Game/SelectedUnitsHandler.h"
+#include "Game/ChatMessage.h"
+#include "Game/WordCompletion.h"
+#include "Game/IVideoCapturing.h"
+#include "Game/InMapDraw.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Game/UI/GameSetupDrawer.h"
+#include "Game/UI/MouseHandler.h"
#include "Lua/LuaRules.h"
-#include "UI/GameSetupDrawer.h"
-#include "UI/MouseHandler.h"
#include "Rendering/GlobalRendering.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Path/IPathManager.h"
#include "System/EventHandler.h"
#include "System/Log/ILog.h"
#include "System/myMath.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
+#include "System/TimeProfiler.h"
#include "System/LoadSave/DemoRecorder.h"
#include "System/Net/UnpackPacket.h"
#include "System/Sound/ISound.h"
@@ -57,22 +58,6 @@ void CGame::AddTraffic(int playerID, int packetCode, int length)
void CGame::ClientReadNet()
{
- if (gu->gameTime - lastCpuUsageTime >= 1) {
- lastCpuUsageTime = gu->gameTime;
-
- if (playing) {
- float simCpuUsage = profiler.GetPercent("SimFrame");
-
- if (!GML::SimEnabled() || !GML::MultiThreadSim()) // take the minimum drawframes into account, too
- simCpuUsage += (profiler.GetPercent("GameController::Draw") / std::max(1.0f, globalRendering->FPS)) * gu->minFPS;
-
- net->Send(CBaseNetProtocol::Get().SendCPUUsage(simCpuUsage));
- } else {
- // the CPU-load percentage is undefined prior to SimFrame()
- net->Send(CBaseNetProtocol::Get().SendCPUUsage(0.0f));
- }
- }
-
boost::shared_ptr<const netcode::RawPacket> packet;
// compute new msgProcTimeLeft to "smooth" out SimFrame() calls
View
4 rts/System/BaseNetProtocol.cpp → rts/Net/Protocol/BaseNetProtocol.cpp
@@ -1,8 +1,8 @@
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
-#include "System/BaseNetProtocol.h"
+#include "BaseNetProtocol.h"
-#include "Game/PlayerStatistics.h"
+#include "Game/Players/PlayerStatistics.h"
#include "Sim/Misc/TeamStatistics.h"
#include "System/Net/RawPacket.h"
#include "System/Net/PackPacket.h"
View
0  rts/System/BaseNetProtocol.h → rts/Net/Protocol/BaseNetProtocol.h
File renamed without changes
View
2  rts/System/NetProtocol.cpp → rts/Net/Protocol/NetProtocol.cpp
@@ -9,7 +9,7 @@
// NOTE: these _must_ be included before NetProtocol.h due to some ambiguity in
// Boost hash_float.hpp ("call of overloaded ‘ldexp(float&, int&)’ is ambiguous")
#include "System/Net/LocalConnection.h"
-#include "System/NetProtocol.h"
+#include "NetProtocol.h"
#include "Game/GameData.h"
#include "Game/GlobalUnsynced.h"
View
2  rts/System/NetProtocol.h → rts/Net/Protocol/NetProtocol.h
@@ -7,7 +7,7 @@
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include "System/BaseNetProtocol.h" // not used in here, but in all files including this one
+#include "BaseNetProtocol.h" // not used in here, but in all files including this one
class CDemoRecorder;
namespace netcode
View
4 rts/Rendering/HUDDrawer.cpp
@@ -8,8 +8,8 @@
#include "Rendering/Models/3DModel.h"
#include "Game/Camera.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Sim/MoveTypes/MoveType.h"
#include "Sim/Units/Unit.h"
#include "Sim/Weapons/Weapon.h"
View
4 rts/Rendering/TeamHighlight.cpp
@@ -4,8 +4,8 @@
#include "ExternalAI/SkirmishAIHandler.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Sim/Misc/TeamHandler.h"
#include "Sim/Misc/GlobalConstants.h"
#include "Sim/Misc/GlobalSynced.h"
View
2  rts/Rendering/UnitDrawer.cpp
@@ -9,7 +9,7 @@
#include "Game/GameHelper.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
+#include "Game/Players/Player.h"
#include "Game/UI/MiniMap.h"
#include "Lua/LuaMaterial.h"
#include "Lua/LuaUnitMaterial.h"
View
6 rts/Sim/Misc/Team.cpp
@@ -5,8 +5,8 @@
#include "TeamHandler.h"
#include "GlobalSynced.h"
#include "ExternalAI/SkirmishAIHandler.h"
-#include "Game/Player.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/Player.h"
+#include "Game/Players/PlayerHandler.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
#include "Game/Messages.h"
@@ -17,7 +17,7 @@
#include "Sim/Units/UnitDef.h"
#include "System/EventHandler.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/MsgStrings.h"
#include "System/Rectangle.h"
#include "System/creg/STL_List.h"
View
4 rts/Sim/MoveTypes/ClassicGroundMoveType.cpp
@@ -43,7 +43,7 @@ void CClassicGroundMoveType::LeaveTransport() {}
#include "Game/Camera.h"
#include "Game/GameHelper.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
+#include "Game/Players/Player.h"
#include "Game/SelectedUnitsHandler.h"
#include "Map/Ground.h"
#include "Map/MapInfo.h"
@@ -92,7 +92,7 @@ CClassicGroundMoveType::CClassicGroundMoveType(CUnit* owner):
skidRotVector(UpVector),
skidRotSpeed2(0.0f),
skidRotPos2(0.0f),
-
+
flatFrontDir(1, 0, 0),
mainHeadingPos(0.0f, 0.0f, 0.0f),
lastGetPathPos(0.0f, 0.0f, 0.0f),
View
2  rts/Sim/MoveTypes/GroundMoveType.cpp
@@ -6,8 +6,8 @@
#include "Game/Camera.h"
#include "Game/GameHelper.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
#include "Game/SelectedUnitsHandler.h"
+#include "Game/Players/Player.h"
#include "Map/Ground.h"
#include "Map/MapInfo.h"
#include "Map/ReadMap.h"
View
2  rts/Sim/MoveTypes/HoverAirMoveType.cpp
@@ -2,7 +2,7 @@
#include "HoverAirMoveType.h"
-#include "Game/Player.h"
+#include "Game/Players/Player.h"
#include "Map/Ground.h"
#include "Sim/Misc/GeometricObjects.h"
#include "Sim/Misc/GroundBlockingObjectMap.h"
View
2  rts/Sim/MoveTypes/StrafeAirMoveType.cpp
@@ -2,7 +2,7 @@
#include "StrafeAirMoveType.h"
-#include "Game/Player.h"
+#include "Game/Players/Player.h"
#include "Map/Ground.h"
#include "Map/MapInfo.h"
#include "Map/ReadMap.h"
View
2  rts/Sim/Path/Default/PathEstimator.cpp
@@ -23,7 +23,7 @@
#include "Sim/MoveTypes/MoveMath/MoveMath.h"
#include "Sim/Units/Unit.h"
#include "Sim/Units/UnitDef.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/TimeProfiler.h"
#include "System/Config/ConfigHandler.h"
#include "System/FileSystem/Archives/IArchive.h"
View
2  rts/Sim/Units/Unit.cpp
@@ -26,8 +26,8 @@
#include "Game/GameHelper.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
-#include "Game/Player.h"
#include "Game/SelectedUnitsHandler.h"
+#include "Game/Players/Player.h"
#include "Lua/LuaRules.h"
#include "Map/Ground.h"
#include "Map/MapInfo.h"
View
2  rts/Sim/Weapons/Weapon.cpp
@@ -4,8 +4,8 @@
#include "WeaponDefHandler.h"
#include "Weapon.h"
#include "Game/GameHelper.h"
-#include "Game/Player.h"
#include "Game/TraceRay.h"
+#include "Game/Players/Player.h"
#include "Lua/LuaRules.h"
#include "Map/Ground.h"
#include "Sim/Misc/CollisionHandler.h"
View
3  rts/System/CMakeLists.txt
@@ -4,8 +4,6 @@
# Then Sound/ stuff was removed, because it is now a separate static lib.
SET(sources_engine_System_common
"${CMAKE_CURRENT_SOURCE_DIR}/AIScriptHandler.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/AutohostInterface.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/BaseNetProtocol.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/ConfigHandler.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/ConfigLocater.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/ConfigSource.cpp"
@@ -32,7 +30,6 @@ SET(sources_engine_System_common
"${CMAKE_CURRENT_SOURCE_DIR}/MemPool.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Misc/RectangleOptimizer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Misc/SpringTime.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/NetProtocol.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Object.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/OffscreenGLContext.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Option.cpp"
View
2  rts/System/LoadSave/CregLoadSaveHandler.cpp
@@ -7,10 +7,10 @@
#include "Map/ReadMap.h"
#include "Game/Game.h"
#include "Game/GameSetup.h"
-#include "Game/GameServer.h"
#include "Game/InMapDrawModel.h"
#include "Game/GlobalUnsynced.h"
#include "Game/WaitCommandsAI.h"
+#include "Net/GameServer.h"
#include "Sim/Features/FeatureHandler.h"
#include "Sim/Units/UnitHandler.h"
#include "Sim/Misc/RadarHandler.h"
View
4 rts/System/LoadSave/DemoReader.h
@@ -8,7 +8,7 @@
#include "Demo.h"
-#include "Game/PlayerStatistics.h"
+#include "Game/Players/PlayerStatistics.h"
#include "Sim/Misc/TeamStatistics.h"
namespace netcode { class RawPacket; }
@@ -47,7 +47,7 @@ class CDemoReader : public CDemo
{
return setupScript;
};
-
+
const std::vector<PlayerStatistics>& GetPlayerStats() const { return playerStats; }
const std::vector< std::vector<TeamStatistics> >& GetTeamStats() const { return teamStats; }
const std::vector< unsigned char >& GetWinningAllyTeams() const { return winningAllyTeams; }
View
4 rts/System/LoadSave/DemoRecorder.h
@@ -8,7 +8,7 @@
#include <list>
#include "Demo.h"
-#include "Game/PlayerStatistics.h"
+#include "Game/Players/PlayerStatistics.h"
#include "Sim/Misc/TeamStatistics.h"
/**
@@ -22,7 +22,7 @@ class CDemoRecorder : public CDemo
void WriteSetupText(const std::string& text);
void SaveToDemo(const unsigned char* buf, const unsigned length, const float modGameTime);
-
+
/**
@brief assign a map name for the demo file
*/
View
2  rts/System/Net/LocalConnection.cpp
@@ -4,9 +4,9 @@
#include <boost/format.hpp>
+#include "Net/Protocol/BaseNetProtocol.h"
#include "Exception.h"
#include "ProtocolDef.h"
-#include "System/BaseNetProtocol.h"
#include "System/Log/ILog.h"
namespace netcode {
View
6 rts/System/Net/UDPConnection.cpp
@@ -14,7 +14,7 @@
#include "Socket.h"
#include "ProtocolDef.h"
#include "Exception.h"
-#include "System/BaseNetProtocol.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/Config/ConfigHandler.h"
#include "System/CRC.h"
#include "System/GlobalConfig.h"
@@ -364,7 +364,7 @@ void UDPConnection::ProcessRawPacket(Packet& incoming)
return;
}
- if (incoming.lastContinuous < 0 && lastInOrder >= 0 &&
+ if (incoming.lastContinuous < 0 && lastInOrder >= 0 &&
(unackedChunks.empty() || unackedChunks[0]->chunkNumber > 0)) {
LOG_L(L_WARNING, "Discarding superfluous reconnection attempt");
return;
@@ -712,7 +712,7 @@ void UDPConnection::SendIfNecessary(bool flushed)
while (resMidIter != resendRequested.end() && resMidIter->first <= lastMidChunk)
++resMidIter;
- if (resMidIter == resendRequested.end() || resMidIterEnd == resendRequested.end() ||
+ if (resMidIter == resendRequested.end() || resMidIterEnd == resendRequested.end() ||
resMidIter->first >= resMidIterEnd->first)
resMidIter = resMidIterStart;
}
View
2  rts/System/Platform/Win/CrashHandler.cpp
@@ -11,7 +11,7 @@
#include "System/Log/ILog.h"
#include "System/Log/LogSinkHandler.h"
#include "System/LogOutput.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "seh.h"
#include "System/Util.h"
#include "System/SafeCStrings.h"
View
6 rts/System/Platform/errorhandler.cpp
@@ -12,8 +12,6 @@
#include <sstream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
-
-#include "Game/GameServer.h"
#include "Game/GlobalUnsynced.h"
#include "System/Log/ILog.h"
#include "System/Log/LogSinkHandler.h"
@@ -27,7 +25,9 @@
#if !defined(DEDICATED) && !defined(HEADLESS)
#include "System/Platform/MessageBox.h"
#endif
-
+#ifdef DEDICATED
+ #include "Net/GameServer.h"
+#endif
static void ExitMessage(const std::string& msg, const std::string& caption, unsigned int flags, bool forced)
{
View
4 rts/System/SpringApp.cpp
@@ -19,7 +19,6 @@
#include "ExternalAI/IAILibraryManager.h"
#include "Game/Benchmark.h"
#include "Game/ClientSetup.h"
-#include "Game/GameServer.h"
#include "Game/GameSetup.h"
#include "Game/GameVersion.h"
#include "Game/GameController.h"
@@ -27,6 +26,7 @@
#include "Game/GlobalUnsynced.h"
#include "Game/PreGame.h"
#include "Game/LoadScreen.h"
+#include "Net/GameServer.h"
#include "Game/UI/KeyBindings.h"
#include "Game/UI/MouseHandler.h"
#include "Lua/LuaOpenGL.h"
@@ -49,7 +49,7 @@
#include "System/LogOutput.h"
#include "System/myMath.h"
#include "System/MsgStrings.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "System/StartScriptGen.h"
#include "System/TimeProfiler.h"
#include "System/Util.h"
View
3  rts/System/Sync/DumpState.cpp
@@ -7,10 +7,9 @@
#include "DumpState.h"
-#include "Game/Game.h"
-#include "Game/GameServer.h"
#include "Game/GameSetup.h"
#include "Game/GlobalUnsynced.h"
+#include "Net/GameServer.h"
#include "Rendering/Models/3DModel.h"
#include "Sim/Features/FeatureHandler.h"
#include "Sim/Misc/TeamHandler.h"
View
7 rts/System/Sync/SyncDebugger.cpp
@@ -4,13 +4,12 @@
#ifdef SYNCDEBUG
#include "SyncDebugger.h"
-
#include "Game/GlobalUnsynced.h"
-#include "Game/PlayerHandler.h"
+#include "Game/Players/PlayerHandler.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "Sim/Misc/GlobalSynced.h"
-#include "System/BaseNetProtocol.h"
#include "System/Log/ILog.h"
-#include "System/NetProtocol.h"
+#include "Net/Protocol/NetProtocol.h"
#include "HsiehHash.h"
#include "Logger.h"
View
10 rts/builds/dedicated/CMakeLists.txt
@@ -76,6 +76,7 @@ SET(system_files
${sources_engine_System_Log}
${sources_engine_System_Net}
${sources_engine_Platform_CrashHandler}
+ ${ENGINE_SRC_ROOT_DIR}/Net/AutohostInterface.cpp
${ENGINE_SRC_ROOT_DIR}/System/Config/ConfigHandler.cpp
${ENGINE_SRC_ROOT_DIR}/System/Config/ConfigLocater.cpp
${ENGINE_SRC_ROOT_DIR}/System/Config/ConfigSource.cpp
@@ -91,11 +92,9 @@ SET(system_files
${ENGINE_SRC_ROOT_DIR}/System/Info.cpp
${ENGINE_SRC_ROOT_DIR}/System/LogOutput.cpp
${ENGINE_SRC_ROOT_DIR}/System/TimeUtil.cpp
- ${ENGINE_SRC_ROOT_DIR}/System/BaseNetProtocol.cpp
${ENGINE_SRC_ROOT_DIR}/System/LoadSave/Demo.cpp
${ENGINE_SRC_ROOT_DIR}/System/LoadSave/DemoReader.cpp
${ENGINE_SRC_ROOT_DIR}/System/LoadSave/DemoRecorder.cpp
- ${ENGINE_SRC_ROOT_DIR}/System/AutohostInterface.cpp
${ENGINE_SRC_ROOT_DIR}/System/SafeCStrings.c
${ENGINE_SRC_ROOT_DIR}/System/UnsyncedRNG.cpp
${ENGINE_SRC_ROOT_DIR}/System/Util.cpp
@@ -115,14 +114,13 @@ ENDIF (WIN32)
SET(engineDedicatedSources
${system_files}
- ${sources_engine_Game_Server}
+ ${sources_engine_NetServer}
${sources_engine_System_Log}
- ${ENGINE_SRC_ROOT_DIR}/Game/GameServer.cpp
${ENGINE_SRC_ROOT_DIR}/Game/ClientSetup.cpp
${ENGINE_SRC_ROOT_DIR}/Game/GameSetup.cpp
${ENGINE_SRC_ROOT_DIR}/Game/GameData.cpp
- ${ENGINE_SRC_ROOT_DIR}/Game/PlayerBase.cpp
- ${ENGINE_SRC_ROOT_DIR}/Game/PlayerStatistics.cpp
+ ${ENGINE_SRC_ROOT_DIR}/Game/Players/PlayerBase.cpp
+ ${ENGINE_SRC_ROOT_DIR}/Game/Players/PlayerStatistics.cpp
${ENGINE_SRC_ROOT_DIR}/Game/GameVersion.cpp
${ENGINE_SRC_ROOT_DIR}/Game/IVideoCapturing.cpp
${ENGINE_SRC_ROOT_DIR}/Game/DummyVideoCapturing.cpp
View
2  rts/builds/dedicated/main.cpp
@@ -8,11 +8,11 @@
#include <SDL.h>
-#include "Game/GameServer.h"
#include "Game/GameSetup.h"
#include "Game/ClientSetup.h"
#include "Game/GameData.h"
#include "Game/GameVersion.h"
+#include "Net/GameServer.h"
#include "System/FileSystem/DataDirLocater.h"
#include "System/FileSystem/FileSystemInitializer.h"
#include "System/FileSystem/ArchiveScanner.h"
View
2  test/CMakeLists.txt
@@ -45,7 +45,7 @@ Else (NOT Boost_FOUND)
Set(test_UDPListener_src
"${CMAKE_CURRENT_SOURCE_DIR}/engine/System/Net/TestUDPListener.cpp"
"${ENGINE_SOURCE_DIR}/Game/GameVersion.cpp"
- "${ENGINE_SOURCE_DIR}/System/BaseNetProtocol.cpp"
+ "${ENGINE_SOURCE_DIR}/Net/Protocol/BaseNetProtocol.h"
"${ENGINE_SOURCE_DIR}/System/Net/UDPListener.cpp"
"${ENGINE_SOURCE_DIR}/System/Net/RawPacket.cpp"
"${ENGINE_SOURCE_DIR}/System/Net/PackPacket.cpp"
View
2  tools/DemoTool/CMakeLists.txt
@@ -16,7 +16,7 @@ ADD_DEFINITIONS(-DTOOLS)
SET(demoToolSpringSources
${ENGINE_SRC_ROOT_DIR}/Game/GameVersion.cpp
- ${ENGINE_SRC_ROOT_DIR}/Game/PlayerStatistics.cpp
+ ${ENGINE_SRC_ROOT_DIR}/Game/Players/PlayerStatistics.cpp
${ENGINE_SRC_ROOT_DIR}/Sim/Misc/TeamStatistics.cpp
${ENGINE_SRC_ROOT_DIR}/System/FileSystem/FileHandler.cpp
${ENGINE_SRC_ROOT_DIR}/System/FileSystem/FileSystem.cpp
View
4 tools/DemoTool/DemoTool.cpp
@@ -6,8 +6,8 @@
#include "StringSerializer.h"
+#include "Net/Protocol/BaseNetProtocol.h"
#include "System/LoadSave/DemoReader.h"
-#include "System/BaseNetProtocol.h"
#include "System/Net/RawPacket.h"
#include "Sim/Units/CommandAI/Command.h"
@@ -85,7 +85,7 @@ int main (int argc, char* argv[])
unsigned team = vm["team"].as<unsigned>();
WriteTeamstatHistory(reader, team, outfile);
}
-
+
if (vm.count("header") || printStats)
{
wstringstream buf;
View
2  tools/DemoTool/StringSerializer.h
@@ -6,7 +6,7 @@
#include <sstream>
#include <cstdio>
-#include "Game/PlayerStatistics.h"
+#include "Game/Players/PlayerStatistics.h"
#include "Sim/Misc/TeamStatistics.h"
#include "System/LoadSave/demofile.h"
Please sign in to comment.
Something went wrong with that request. Please try again.