commit c40e8c02354a4880ca7df5f7deb0e9d646b2d954 Author: Jessica James Date: Sat May 23 10:18:55 2020 -0500 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/DllBind.puml b/DllBind.puml new file mode 100644 index 0000000..5f06156 --- /dev/null +++ b/DllBind.puml @@ -0,0 +1,50 @@ +@startuml + +allowmixing + +enum AuthRequestStatus { + Success // Logged in successfully + Failure // bad token, bad credentials + Timeout // API didn't respond + RequestInProgress // Still waiting for response +} + +class DllBind { + +bool ClearCachedAuthID(); + + +bool StartVerifyCachedAuthID(int timeout_ms); + +void StartLoginRequest(string user, string password); + +void StartJoinServerRequest(string serverIP, int serverPort); + +AuthRequestStatus CheckAuthRequest(); +} + +cloud "Website / AuthServer API" { + class /register { + Type: Post + Payload: Email, Username, Password + Response: Success/Failure + } + + class /validate { + Type: Post + Payload: AuthID, UserID + Response: Success/Failure + } + + class /login { + Type: Post + Payload: Email or Username, Password + Response: Success/Failure + } + + class /resetPassword { + Type: Post + Payload: Email or Username + Failure Response: No such account + Success Response: Check your email + } +} + +hide empty members + +@enduml \ No newline at end of file diff --git a/Failover.puml b/Failover.puml new file mode 100644 index 0000000..a9b0707 --- /dev/null +++ b/Failover.puml @@ -0,0 +1,57 @@ +@startuml + +together { + actor "New Player" as NewUser + actor "Old Player" as OldUser + + note left of NewUser { + This is any player who has + only been in this match + } + + note right of OldUser { + This is any player who was + also in the previous match + + We trust this guy a little more, + because the DDoSer probably isn't + playing real games. + } +} + +cloud "Public Proxy Servers" as PubProxies { + node cmg1 + node cmg2 +} + +note bottom of PubProxies + These are the only nodes + put on the server list +end note + +cloud "Private Proxy Servers" as PrivProxies { + node bong1 + + note as PrivProxiesNote + We move previous players here so that when + the public proxy servers are inevitably taken + down, these guys won't get disconnected! + end note +} + +cloud "Private Game Servers" as PrivServers { + node "Official NA" as NA1 + node "Official EU" as EU1 + + note as PrivServersNote + These are never exposed, to anybody at all + end note +} + +NewUser --> PubProxies +OldUser --> PrivProxies +PubProxies --> PrivServers +PrivProxies --> PrivServers +NewUser ..> PrivProxies : Used only when in failover + +@enduml \ No newline at end of file diff --git a/Login Sequence.puml b/Login Sequence.puml new file mode 100644 index 0000000..ea55c01 --- /dev/null +++ b/Login Sequence.puml @@ -0,0 +1,96 @@ +@startuml + +box User (Untrusted) + participant User + participant "Game Client" as Game + participant "DLL Bind" as DllBind + participant "Windows Registry" as Registry +end box + +box Official Infrastructure (Trusted) #LightBlue + participant "Renegade X Website" as AuthServer +end box + +User -> Game: Launch +Game -> User: Loading Screen (intro video) +group Validate Cached AuthID + Game -> DllBind: StartVerifyCachedAuthID() + DllBind -> Registry: Read AuthToken + activate Registry + return AuthToken value + alt AuthToken exists + DllBind -> AuthServer: Validate AuthID Request + DllBind -> Game: True (Request started) + loop Wait for response + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: RequestInProgress + end + alt Authentication success + AuthServer --> DllBind: Authentication Token, ID + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Success + Game -> User: Go to main menu / join server + else Authentication failed + AuthServer --> DllBind: Authentication Failed + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Failure + Game -> User: Go to Login Screen + else Authentication Server Offline / No Response + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Timeout + Game -> User: "Unable to login; continue anyways?" + alt User clicks 'Yes' + User -> Game: Yes + Game -> User: Go to main menu / join server + else User clicks 'Exit' + User -> Game: Exit + Game -> Game: Exit + end + end + else + DllBind -> Game: False (No cached credentials) + Game -> User: Go to Login + end +end + +group Login + User -> Game: Login Credentials + Game -> DllBind: StartLoginRequest() + DllBind -> AuthServer: Authentication Request + DllBind --> Game + + loop Wait for response + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: RequestInProgress + end + + alt Authentication Success + AuthServer --> DllBind: Authentication Token, UserID + opt Remember Me Checkbox Checked + DllBind -> Registry: Store AuthID, UserID + activate Registry + return + end + + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Success + Game --> User: Login Success; go to main menu / join server + else Authentication Failure + AuthServer --> DllBind: Authentication Failed + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Failure + Game --> User: Display error; repeat Login + else Authentication Server Offline / No Response + Game -> DllBind: CheckAuthRequest() + DllBind --> Game: Timeout + Game -> User: "Unable to login; continue anyways?" + alt User clicks 'Yes' + User -> Game: Yes + Game -> User: Go to main menu / join server + else User clicks 'Exit' + Game -> Game: Exit + end + end +end + +@enduml \ No newline at end of file diff --git a/Server Join Sequence.puml b/Server Join Sequence.puml new file mode 100644 index 0000000..aa04aa9 --- /dev/null +++ b/Server Join Sequence.puml @@ -0,0 +1,63 @@ +@startuml + +box User (Untrusted) + participant User + participant "Game Client" as Game + participant DllBind +end box + +box Game Server Infrastructure (Untrusted) + participant "Game Server" as GameServer + participant RCON +end box + +box Official Infrastructure (Trusted) #LightBlue + participant "DevBot" as DevBot + participant "Renegade X Website" as AuthServer +end box + +Game <-> GameServer: Normal UDK Game Join +== Begin Normal Game Play == + +Game -> GameServer: HWID + +group Token Validation + Game -> DllBind: StartJoinServerRequest(IP, Port) + DllBind -> DevBot: Auth Payload + note left + Note: Validation needs to go through the DevBot, + so that the DevBot can get a verifiable response + from the AuthServer. Otherwise, the ID would have + to be validated twice -- once by the game server, + and once by the DevBot. + + Additionally, if the DevBot is offline, then no + response will actually be received. This means the + player is neither authenticated, nor kicked. They're + just unauthenticated by default. + end note + + opt DevBot online + DevBot -> AuthServer: Validate ID Request + alt Token is valid + AuthServer --> DevBot: Validation Success + DevBot -> GameServer: Auth Success for ID + GameServer -> RCON: Auth Success for ID + else Token is bad + AuthServer --> DevBot: Validation Failure + DevBot -> GameServer: Kick Player, Reason: "Invalid Login" + GameServer -> Game: Kick Player + Game -> User: Present Login Screen + else Site Offline / Timed Out + DevBot -> GameServer: Auth Failure for ID + GameServer -> RCON: Auth Failure for ID + end + end + +else Invalid Client (Client Doesn't Send Payload) + DevBot -> GameServer: Kick Player, Reason: "Invalid Login" + note right: Caused by 3 second timeout + GameServer -> Game: Kick Player, Reason: "Invalid Login" +end + +@enduml \ No newline at end of file