From 450f4249f34a80d6f5509af32c50d2f61eaadc69 Mon Sep 17 00:00:00 2001 From: Dennis Andersen Date: Mon, 10 Feb 2014 22:25:31 +0100 Subject: [PATCH] Documentation - Updated uml diagrams --- Code/Dokumentation/Danbias Structure.uxf | 455 ++++++++++-------- Code/Dokumentation/GameServer.uxf | 311 ++++++------ Code/Dokumentation/Resource.uxf | 260 ++++++++-- .../GameClientState/LobbyState.cpp | 2 +- .../GameClientState/LoginState.cpp | 1 + Code/Misc/Misc.vcxproj | 42 +- Code/Misc/Resource/ResourceManager.h | 3 +- 7 files changed, 657 insertions(+), 417 deletions(-) diff --git a/Code/Dokumentation/Danbias Structure.uxf b/Code/Dokumentation/Danbias Structure.uxf index c24380c9..d52aa795 100644 --- a/Code/Dokumentation/Danbias Structure.uxf +++ b/Code/Dokumentation/Danbias Structure.uxf @@ -1,212 +1,197 @@ - 11 + 7 com.umlet.element.Class - 847 - 363 - 132 - 33 + 728 + 413 + 91 + 21 - Graphics + Graphics <<module>> +bg=orange com.umlet.element.Class - 561 - 363 - 132 - 33 + 546 + 413 + 84 + 21 - Sound + Sound<<?>> com.umlet.element.Class - 671 - 209 - 132 - 33 + 616 + 322 + 84 + 21 - Physics + Physics <<module>> +bg=orange com.umlet.element.Class - 858 - 132 - 121 - 33 + 735 + 238 + 77 + 21 - Game client + Game client <<dll>> +bg=red com.umlet.element.Class - 484 - 209 - 154 - 33 + 616 + 287 + 98 + 21 - Gamelogic + Gamelogic <<dll>> +bg=red com.umlet.element.Class - 506 - 132 - 121 - 33 + 504 + 238 + 84 + 21 - Game server + Game server <<dll>> +bg=red com.umlet.element.Class - 671 - 132 - 132 - 33 + 616 + 238 + 84 + 21 - Network + Network <<module>> +bg=orange com.umlet.element.Class - 704 - 363 - 132 - 33 + 637 + 413 + 84 + 21 - Input + Input<<lib>> +bg=blue com.umlet.element.Class - 495 - 55 - 176 - 44 + 714 + 182 + 98 + 28 - DanBiasClientLauncher + GameLauncher <<exe>> bg=green com.umlet.element.Relation - 880 - 132 - 54 - 252 + 749 + 238 + 34 + 188 lt=<- - 33;231;33;209;33;33 + 21;175;21;161;21;21 com.umlet.element.Relation - 583 - 132 - 351 - 252 + 560 + 238 + 223 + 188 lt=<- - 33;231;33;209;330;209;330;33 + 21;175;21;161;210;161;210;21 com.umlet.element.Relation - 528 - 132 - 54 - 98 + 525 + 238 + 146 + 62 lt=<- - 33;77;33;33 + 133;49;133;35;21;35;21;21 com.umlet.element.Relation - 594 - 110 - 98 - 54 + 567 + 224 + 62 + 34 lt=<- - 77;33;33;33 + 49;21;21;21 com.umlet.element.Relation - 605 - 187 - 87 - 54 + 637 + 287 + 34 + 48 lt=<- - 66;33;33;33 + 21;35;21;21 com.umlet.element.Relation - 737 - 132 - 197 - 252 + 658 + 238 + 125 + 188 lt=<- - 33;231;33;209;176;209;176;33 + 21;175;21;161;112;161;112;21 com.umlet.element.Relation - 770 - 110 - 109 - 54 + 679 + 224 + 69 + 34 lt=<- - 33;33;88;33 - - - com.umlet.element.Relation - - 880 - 66 - 54 - 87 - - lt=>- - 33;33;33;66 - - - com.umlet.element.Relation - - 528 - 66 - 54 - 87 - - lt=>- - 33;33;33;66 + 21;21;56;21 com.umlet.element.Package - 440 - 22 - 550 - 396 + 455 + 161 + 371 + 287 GameEngine @@ -214,21 +199,21 @@ bg=green com.umlet.element.Relation - 880 - 363 - 54 - 164 + 749 + 413 + 34 + 104 lt=<<. - 33;33;33;143 + 21;21;21;91 com.umlet.element.Package - 891 - 506 - 319 - 220 + 756 + 504 + 203 + 140 Graphics @@ -236,10 +221,10 @@ bg=green com.umlet.element.Class - 902 - 539 - 297 - 176 + 763 + 525 + 189 + 112 <<interface>> OysterGfx @@ -256,10 +241,10 @@ Release(resource :Model*) :void com.umlet.element.Package - 561 - 506 - 308 - 242 + 546 + 504 + 196 + 154 Input @@ -267,21 +252,21 @@ Release(resource :Model*) :void com.umlet.element.Relation - 649 - 363 - 142 - 175 + 602 + 413 + 90 + 111 lt=<<. - 121;33;121;154;33;154 + 77;21;77;98;21;98 com.umlet.element.Class - 572 - 539 - 286 - 198 + 553 + 525 + 182 + 126 <<interface>> RawInput @@ -299,32 +284,33 @@ Enable(Enable :bool) :void com.umlet.element.Class - 451 - 363 - 99 - 33 + 462 + 413 + 77 + 21 - Window API + Window API<<lib>> +bg=blue com.umlet.element.Relation - 462 - 132 - 472 - 252 + 483 + 238 + 300 + 188 lt=<- - 33;231;33;209;451;209;451;33 + 21;175;21;161;287;161;287;21 com.umlet.element.Package - 176 - 506 - 374 - 242 + 301 + 504 + 238 + 154 Sound @@ -332,10 +318,10 @@ Enable(Enable :bool) :void com.umlet.element.Class - 187 - 539 - 352 - 121 + 308 + 525 + 224 + 77 <<interface>> SoundWrapper @@ -349,10 +335,10 @@ Release(Resource :ResourceHandle*) :void com.umlet.element.Class - 187 - 693 - 352 - 44 + 308 + 623 + 224 + 28 <<API>> -- @@ -362,79 +348,152 @@ FMOD com.umlet.element.Relation - 330 - 627 - 54 - 87 + 399 + 581 + 34 + 55 lt=<<. - 33;66;33;33 + 21;42;21;21 com.umlet.element.Relation - 286 - 363 - 362 - 175 + 371 + 413 + 230 + 111 lt=<<. - 341;33;341;88;253;88;253;154;33;154 + 217;21;217;56;161;56;161;98;21;98 com.umlet.element.Class - 781 - 55 - 198 - 44 + 476 + 329 + 84 + 28 - DanBiasServerLauncher + Math <<lib>> +-- +/Is used globaly/ +bg=blue + + + + com.umlet.element.Relation + + 539 + 238 + 237 + 125 + + lt=<- + 21;112;224;112;224;21 + + + com.umlet.element.Class + + 476 + 294 + 77 + 28 + + Misc <<lib>> +-- +/Is used globaly/ +bg=blue + + + + com.umlet.element.Relation + + 539 + 273 + 90 + 76 + + lt=<- + 21;63;56;63;56;21;77;21 + + + UMLClass + + 105 + 168 + 245 + 140 + + /*HISTORY*/ +-- +10/2-2014 +Renamed DanBiasClientLauncher -> GameLauncher +Removed DanBiasServerLauncher - connected to GameClient +Added missing cconnections +Specified what type of box and added a colour +-- +elementstyle=wordwrap +bg=gray + + + + + com.umlet.element.Relation + + 749 + 189 + 34 + 62 + + lt=<- + 21;49;21;21 + + + com.umlet.element.Class + + 504 + 189 + 91 + 28 + + ServerUI <<exe>> +-- +/template for future/ bg=green - com.umlet.element.Class + com.umlet.element.Relation - 671 - 253 - 132 - 33 + 525 + 196 + 34 + 55 - Math - + lt=<- + 21;42;21;21 com.umlet.element.Relation - 770 - 132 - 153 - 164 + 539 + 308 + 90 + 48 lt=<- - 33;143;132;143;132;33 - - - com.umlet.element.Class - - 682 - 297 - 99 - 33 - - Misc - + 21;35;63;35;63;21;77;21 com.umlet.element.Relation - 605 - 198 - 87 - 98 + 532 + 273 + 97 + 41 lt=<- - 66;77;44;77;44;33;33;33 + 21;28;56;28;56;21;84;21 diff --git a/Code/Dokumentation/GameServer.uxf b/Code/Dokumentation/GameServer.uxf index 735a2592..890e2cbb 100644 --- a/Code/Dokumentation/GameServer.uxf +++ b/Code/Dokumentation/GameServer.uxf @@ -1,13 +1,13 @@ - - 10 + + 8 UMLClass - 610 - 340 - 100 - 30 + 632 + 344 + 104 + 24 GameLobby @@ -16,137 +16,100 @@ UMLClass - 580 - 480 - 160 - 80 + 624 + 416 + 128 + 48 GameSession -- /One instance of a game/ -/including x number of/ -/players./ +/including n players./ com.umlet.element.Relation - 620 - 340 - 60 - 160 + 664 + 344 + 40 + 88 lt=->>>> - 30;140;40;30 + 24;72;24;24 com.umlet.element.Relation - 710 - 480 - 100 - 50 + 664 + 440 + 40 + 104 lt=>>>>- - 80;30;30;30 + 24;88;24;24 UMLClass - 600 - 180 - 120 - 120 + 40 + 120 + 368 + 344 - GameServer + GameServerAPI <<singleton>> +-- +{innerclass ++ServerInitDesc<<struct>> +-- +serverName :char pointer +listenPort :int +bool broadcast :bool +ServerInitDesc() :void +innerclass} +{innerclass ++GameServerInfo<<struct>> +-- +listenPort :unsigned int +serverIp :const char pointer +innerclass} + ++static DanBiasServerReturn ServerInitiate(const ServerInitDesc& desc); ++static ServerStart() :void ++static ServerStop() :void ++static ServerUpdate() :void ++static ServerGetInfo() :GameServerInfo ++static ServerIsRunning() :bool ++static GameSetMapId( val :const int& ) :void ++static GameSetMaxClients( val :const int& ) :void ++static GameSetGameMode(val :const int&) :void ++static GameSetGameTime(val :const int&) :void ++static GameGetMapId() :int ++static GameGetMaxClients() :int ++static GameGetGameMode() :int ++static GameGetGameTime() :int ++static GameGetGameName() :const char pointer ++static GameStart() :bool com.umlet.element.Relation - 630 - 270 - 50 - 90 - - lt=>>>>- - 30;70;30;30 - - - UMLClass - - 590 - 100 - 130 + 384 + 328 + 264 40 - <<wrapper>> -DanBiasServerAPI - - - - com.umlet.element.Relation - - 630 - 110 - 50 - 90 - - lt=>>>>- - - 30;70;30;30 - - - UMLClass - - 1060 - 330 - 120 - 50 - - NetworkSession - - - - com.umlet.element.Relation - - 690 - 220 - 390 - 50 - - lt=-<<<< - 30;30;370;30 - - - com.umlet.element.Relation - - 680 - 320 - 400 - 50 - - lt=->>>>> - 30;30;380;30 - - - com.umlet.element.Relation - - 690 - 340 - 390 - 160 - - lt=->>>>> - 30;140;40;40;370;30 + lt=>>>>- + 248;24;24;24 com.umlet.element.Package - 460 - 640 - 120 - 50 + 440 + 424 + 96 + 40 GameLogicAPI bg=blue @@ -155,21 +118,21 @@ bg=blue com.umlet.element.Relation - 370 - 530 - 350 - 290 + 512 + 424 + 128 + 40 lt=<<. - 90;150;30;270;330;240;240;30 + 24;24;112;24 UMLClass - 790 - 500 - 100 - 30 + 624 + 528 + 144 + 24 GameClient @@ -177,21 +140,21 @@ bg=blue com.umlet.element.Relation - 670 - 530 - 150 - 180 + 520 + 416 + 120 + 104 lt=<<. - 130;160;30;30 + 24;88;64;88;64;24;104;24 com.umlet.element.Package - 800 - 670 - 120 - 40 + 448 + 480 + 96 + 48 GameProtocols bg=#aaaaa @@ -200,10 +163,10 @@ bg=#aaaaa com.umlet.element.Package - 1040 - 200 - 160 - 190 + 720 + 160 + 152 + 24 NetworkAPI bg=#a21aff @@ -212,56 +175,84 @@ bg=#a21aff UMLClass - 1060 - 280 - 120 - 40 + 40 + 24 + 320 + 64 - NetworkClient - - - - UMLClass - - 1060 - 230 - 120 - 40 - - NetworkServer + /*HISTORY*/ +-- +10/2-2014 +Restructured old +-- +elementstyle=wordwrap +bg=gray com.umlet.element.Relation - 690 - 240 - 390 - 80 + 720 + 160 + 40 + 272 - lt=-> - 30;30;200;30;200;60;370;60 + lt=<<. + 24;24;24;256 com.umlet.element.Relation - 690 - 260 - 390 - 100 + 704 + 160 + 40 + 200 - lt=-<<<< - 30;30;180;30;180;80;370;80 + lt=<<. + 24;24;24;184 com.umlet.element.Relation - 860 - 270 - 380 - 260 + 384 + 152 + 352 + 40 - lt=>>>- - 320;30;360;30;360;230;30;240 + lt=<<. + 336;24;24;24 + + + com.umlet.element.Relation + + 736 + 160 + 40 + 384 + + lt=<<. + 24;24;24;368 + + + com.umlet.element.Relation + + 520 + 480 + 136 + 64 + + lt=<<. + 24;24;120;24;120;48 + + + com.umlet.element.Relation + + 512 + 432 + 160 + 112 + + lt=<<. + 24;24;72;24;72;72;144;72;144;96 diff --git a/Code/Dokumentation/Resource.uxf b/Code/Dokumentation/Resource.uxf index c62ae895..1258c9af 100644 --- a/Code/Dokumentation/Resource.uxf +++ b/Code/Dokumentation/Resource.uxf @@ -1,13 +1,13 @@ - - 16 + + 6 com.umlet.element.Class - 560 - 80 - 176 - 80 + 198 + 300 + 66 + 30 <<interface>> OysterResource @@ -16,23 +16,23 @@ OysterResource com.umlet.element.Relation - 528 - 112 - 206 - 160 + 186 + 312 + 76 + 60 lt=>> implements - 112;128;112;48 + 42;48;42;18 com.umlet.element.Actor - 352 - 240 - 128 - 192 + 120 + 360 + 48 + 72 Dev @@ -40,22 +40,22 @@ implements com.umlet.element.Relation - 320 - 32 - 272 - 240 + 108 + 282 + 102 + 90 lt=<. interacts> - 240;80;96;80;96;208 + 90;30;36;30;36;78 com.umlet.element.Class - 576 - 576 - 160 - 32 + 204 + 486 + 60 + 12 CustomLoader @@ -63,10 +63,10 @@ interacts> com.umlet.element.Class - 576 - 528 - 160 - 32 + 204 + 468 + 60 + 12 ByteLoader @@ -75,33 +75,33 @@ ByteLoader com.umlet.element.Relation - 464 - 384 - 144 - 192 + 162 + 414 + 54 + 72 lt=<<- - 80;48;48;48;48;160;112;160 + 30;18;18;18;18;60;42;60 com.umlet.element.Relation - 368 - 384 - 266 - 240 + 126 + 414 + 98 + 90 lt=<<- implements partly - 176;48;144;48;144;208;208;208 + 66;18;54;18;54;78;78;78 UMLClass - 544 - 240 - 208 - 128 + 192 + 360 + 78 + 48 -- <<interface>> @@ -115,10 +115,10 @@ halign=center UMLClass - 544 - 400 - 208 - 80 + 192 + 420 + 78 + 30 OResource @@ -130,13 +130,171 @@ halign=center com.umlet.element.Relation - 688 - 256 - 196 - 224 + 252 + 366 + 66 + 84 lt=>>>> manages> - 64;192;112;192;112;48;64;48 + 18;72;36;72;36;18;18;18 + + + UMLClass + + 108 + 282 + 240 + 234 + + old +bg=gray + + + + UMLClass + + 402 + 342 + 576 + 204 + + ResourceManager +-- ++ ResourceManager() :void ++ ~ResourceManager() :void ++ HBYTEARRAY LoadBytes(const wchar_t filename[], ResourceType type, int customId = -1, bool force = false) ++ HRESOURCE LoadResource(const wchar_t filename[], LoadFunction loadFnc = 0, UnloadFunction unloadFnc = 0, int customId = -1, bool force = false) ++ HRESOURCE ReloadResource(const wchar_t filename[]) ++ HRESOURCE ReloadResource(HRESOURCE& resource) ++ void Clean() ++ void ReleaseResource(const HRESOURCE& resource) ++ void ReleaseResource(const wchar_t filename[]) ++ void SetResourceId(const HRESOURCE& resource, unsigned int id) ++ void SetResourceId(const wchar_t filename[], unsigned int id) ++ ResourceType GetResourceType(const HRESOURCE& resource) ++ ResourceType GetResourceType (const wchar_t filename[]) ++ const wchar_t* GetResourceFilename(const HRESOURCE& resource); ++ HRESOURCE GetResourceHandle(const wchar_t filename[]) ++ int GetResourceId(const HRESOURCE& resource); ++ int GetResourceId(const wchar_t filename[]); +-- +- ResourceManager(const ResourceManager& obj); +- const ResourceManager& operator=(const ResourceManager&); +- std::map<std::wstring, ResourceData*> resources; + + + + UMLClass + + 390 + 198 + 600 + 360 + + Oyster <<namespace>> +-- + + + + + UMLClass + + 396 + 222 + 588 + 330 + + Resource <<namespace>> +-- + + + + + UMLClass + + 534 + 282 + 126 + 18 + + HRESOURCE: void* <<typedef>> + + + + UMLClass + + 534 + 300 + 126 + 18 + + HBYTE: char <<typedef>> + + + + UMLClass + + 534 + 318 + 126 + 18 + + HBYTEARRAY: char* <<typedef>> + + + + UMLClass + + 534 + 246 + 264 + 18 + + UnloadFunction :void(*UnloadFunction)(void* loadedData) <<typedef>> + + + + UMLClass + + 534 + 264 + 288 + 18 + + LoadFunction :void*(*LoadFunction)(const wchar_t filename[]) <<typedef>> + + + + UMLClass + + 402 + 246 + 126 + 90 + + ResourceType <<enum>> +-- +ResourceType_Byte_Raw +ResourceType_Byte_ANSI +ResourceType_Byte_UTF8 +ResourceType_Byte_UNICODE +ResourceType_Byte_UTF16LE +ResourceType_CUSTOM +ResourceType_INVALID + + + + + UMLClass + + 378 + 174 + 630 + 396 + + New +bg=green + diff --git a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp index ccfe636d..98d192dd 100644 --- a/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LobbyState.cpp @@ -95,7 +95,7 @@ GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* Key { if(!DanBias::GameServerAPI::GameStart()) { - //this->nwClient->Send(GameLogic::Protocol_LobbyStartGame()); + } } } diff --git a/Code/Game/DanBiasGame/GameClientState/LoginState.cpp b/Code/Game/DanBiasGame/GameClientState/LoginState.cpp index e2392558..4b6c8df9 100644 --- a/Code/Game/DanBiasGame/GameClientState/LoginState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/LoginState.cpp @@ -119,6 +119,7 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key { // game ip nwClient->Connect(15152, "127.0.0.1"); + //nwClient->Connect(15152, "83.254.217.248"); if (!nwClient->IsConnected()) { diff --git a/Code/Misc/Misc.vcxproj b/Code/Misc/Misc.vcxproj index 2d9392a3..512784e7 100644 --- a/Code/Misc/Misc.vcxproj +++ b/Code/Misc/Misc.vcxproj @@ -147,10 +147,30 @@ - - - - + + false + false + false + false + + + false + false + false + false + + + false + false + false + false + + + false + false + false + false + false false @@ -171,8 +191,18 @@ - - + + false + false + false + false + + + false + false + false + false + false false diff --git a/Code/Misc/Resource/ResourceManager.h b/Code/Misc/Resource/ResourceManager.h index 4c90966e..43aa0215 100644 --- a/Code/Misc/Resource/ResourceManager.h +++ b/Code/Misc/Resource/ResourceManager.h @@ -13,6 +13,7 @@ namespace Oyster typedef void* HRESOURCE; typedef char HBYTE; typedef HBYTE* HBYTEARRAY; + /** Typedef on a fuction required for custom unloading */ typedef void(*UnloadFunction)(void* loadedData); @@ -30,7 +31,7 @@ namespace Oyster ResourceType_Byte_UTF16LE, /**< Handle can be interpeted as char[] or char* */ ResourceType_CUSTOM, /**< Handle can be interpeted as whatever */ - ResourceType_INVALID, /**< Handle can be interpeted as whatever */ + ResourceType_INVALID, }; /** A resource handler interface to interact with when loading resources.