diff options
| author | Darkelarious <darkelarious@333networks.com> | 2021-01-22 19:20:10 +0000 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2021-01-22 19:20:10 +0000 |
| commit | d39db7650b22d1ebf1d077dfc7a6ba5a36e5df0b (patch) | |
| tree | 1874dd76a8424fcaf2f4662382328f3f9858838d /src | |
| parent | 6b7437536bbf9fa1219ed2657fe53b4767fdda1d (diff) | |
| download | MasterServer-Documentation-d39db7650b22d1ebf1d077dfc7a6ba5a36e5df0b.tar.gz MasterServer-Documentation-d39db7650b22d1ebf1d077dfc7a6ba5a36e5df0b.zip | |
handwritten notes to Tikz, add list of issues to appendices
Diffstat (limited to 'src')
| -rwxr-xr-x | src/appendices/issues.tex | 4 | ||||
| -rwxr-xr-x | src/body/background.tex | 6 | ||||
| -rwxr-xr-x | src/body/heartbeat.tex | 25 | ||||
| -rwxr-xr-x | src/body/serverlist.tex | 13 | ||||
| -rwxr-xr-x | src/body/status.tex | 13 | ||||
| -rwxr-xr-x | src/doc.tex | 1 | ||||
| -rw-r--r-- | src/img/client-exchange.png | bin | 32561 -> 0 bytes | |||
| -rw-r--r-- | src/img/general-overview.png | bin | 11961 -> 0 bytes | |||
| -rw-r--r-- | src/img/heartbeat-exchange.png | bin | 26327 -> 0 bytes | |||
| -rw-r--r-- | src/img/overview-cgs.png | bin | 16912 -> 0 bytes | |||
| -rw-r--r-- | src/img/overview-cms.png | bin | 16535 -> 0 bytes | |||
| -rw-r--r-- | src/img/overview-hb.png | bin | 16474 -> 0 bytes | |||
| -rw-r--r-- | src/img/status-exchange.png | bin | 20514 -> 0 bytes | |||
| -rwxr-xr-x | src/layout/headers.tex | 39 | ||||
| -rw-r--r-- | src/lst/gs0protocol.txt | 2 | ||||
| -rwxr-xr-x | src/tikz/client-exchange.tex | 54 | ||||
| -rwxr-xr-x | src/tikz/heartbeat-exchange.tex | 34 | ||||
| -rwxr-xr-x | src/tikz/overview-cgs.tex | 20 | ||||
| -rwxr-xr-x | src/tikz/overview-cms.tex | 20 | ||||
| -rwxr-xr-x | src/tikz/overview-hb.tex | 20 | ||||
| -rwxr-xr-x | src/tikz/overview.tex | 20 | ||||
| -rwxr-xr-x | src/tikz/status-exchange.tex | 47 |
22 files changed, 289 insertions, 29 deletions
diff --git a/src/appendices/issues.tex b/src/appendices/issues.tex new file mode 100755 index 0000000..bdf7bb5 --- /dev/null +++ b/src/appendices/issues.tex @@ -0,0 +1,4 @@ +\chapter{Issues} +\label{app:issues} +Open (and later on closed) issues with the masterserver and how to solve them. + diff --git a/src/body/background.tex b/src/body/background.tex index a7d0e3b..88bc72f 100755 --- a/src/body/background.tex +++ b/src/body/background.tex @@ -12,9 +12,9 @@ From the poker analogy, we continue to multiple games. In the local bar, several To illustrate the more technical interactions between dealers, barkeep and player, we create three roles: {\bf gameserver}, {\bf masterserver} and {\bf client}\footnote{We refer to \emph{gameservers} and \emph{masterservers} instead of \emph{game-} and \emph{master} servers. The latter is correct English, but the former improves readability and avoids confusion about what type of server we explicitly try to describe.} in figure \ref{fig:totaloverview}. When a gameserver is initialised, it repeatedly sends a signal to the masterserver (1). We refer to these signals as \emph{heartbeats}, as the masterserver listens for these signals to determine if the gameserver is still active, similar to how we listen for heartbeats in the human body to determine if somebody is still alive. Game clients make a request to the masterserver to obtain a list of all servers that sent heartbeats and the masterserver provides this list (2). The client then inquires at all of these gameservers for their information (or \emph{status}) so that the user can make a choice which gameserver to join (3). \begin{figure}[ht] - \centering - \includegraphics[width=\textwidth]{img/general-overview} - \caption{General interactions between gameserver, masterserver and client.}\label{fig:totaloverview} +\centering +\input{tikz/overview} +\caption{General interactions between gameserver, masterserver and client.}\label{fig:totaloverview} \end{figure} All interactions between gameserver, masterserver and client occur over the internet. To avoid a wild growth of different methods to convey the information, GameSpy created a format of communication to handle many games with the same approach. When different gameservers follow the same protocol, the same interaction can be applied for a large variety in games. In other words, one barkeep could keep a room list for poker, monopoly, bridge and other games, instead of having one barkeep for every game: the masterserver can handle different games that use the same form of communication. diff --git a/src/body/heartbeat.tex b/src/body/heartbeat.tex index ad365fb..00430e3 100755 --- a/src/body/heartbeat.tex +++ b/src/body/heartbeat.tex @@ -4,9 +4,9 @@ In this chapter, we discuss what information a heartbeat contains and how it is processed by the masterserver. \begin{figure}[ht] - \centering - \includegraphics[width=\textwidth]{img/overview-hb} - \caption{Focus on interaction between gameserver and masterserver}\label{fig:overviewhb} +\centering +\input{tikz/overview-hb} +\caption{Focus on interaction between gameserver and masterserver}\label{fig:overviewhb} \end{figure} \section{Exchange} @@ -19,9 +19,10 @@ Heartbeats are sent repeatedly to indicate that a server is still active. The na This exchange is visualised in a diagram in figure \ref{fig:heartbeat} where the vertical axis represents passing time and the horizontal interactions correspond to the exchange discussed above. \begin{figure}[ht] - \centering - \includegraphics[width=\textwidth]{img/heartbeat-exchange} - \caption{Interaction between gameserver and masterserver}\label{fig:heartbeat} +\centering +\input{tikz/heartbeat-exchange} +\caption{UDP interaction between the gameserver (left) and masterserver (right) over time.} +\label{fig:heartbeat} \end{figure} \section{Secure challenge} @@ -29,22 +30,22 @@ To authenticate the validity of gameserver, masterserver and client, the GameSpy Both the secure word and cipher may consist of any uppercase or lowercase character and any number. The validate word is a calculated response and can contain any uppercase or lowercase character and any number, but also certain special characters such as (back)slashes, underscores and dashes. Later versions of the algorithm also allow to specify an encryption type, which results in a different validate word. The algorithm to determine the validate word consists of a series of array operations and is purely mathematical\cite{lam}. -\section{Formatting} -Many of the games published between 1995 and 2005 follow the GameSpy protocol\cite{gs0} and communicate heartbeats over the user datagram protocol (UDP). Sending data over UDP is fast at the risk of losing packets, corrupted packets or the information arriving out of order. Heartbeats contain only little quantities of information and are sent every few minutes, which minimises the risk and effect of data not arriving properly. +\section{Formatting of data} +Many of the games published between 1995 and 2005 follow the GameSpy protocol\cite{gs0} and communicate heartbeats over the user datagram protocol (UDP). Sending data over UDP is fast at the risk of losing packets, corrupted packets or the information arriving out of order. Heartbeats contain only little quantities of information and are sent every few minutes, which minimises the chance and effect that data does not arrive properly. \lstinputlisting[caption={Example of the GameSpy protocol message formatting.}, stepnumber=1, label={ls:gs0prot}]{lst/gs0protocol.txt} -The GameSpy protocol formats the messages through a backslash. In example \ref{ls:gs0prot}, the first line specifies the general format where there is a keyword, followed by a value, both prefixed by a backslash. A simple heartbeat can be represented by the second line of the example: the {\tt heartbeat} key indicates that the next value is the network port through which the gameserver can be queried and the {\tt gamename} key indicates that the next value is an acronym or shorthand for the game title. An example of how the secure challenge and response would appear is seen at lines 3 and 4. +The GameSpy protocol formats the messages through backslashes. The general definition and examples of these messages are seen in example \ref{ls:gs0prot}, where the first line specifies the general format. The first word is a keyword, followed by a value, both prefixed by a backslash. Multiple keys and values can be appended to contain multiple game properties in a single message. A simple heartbeat is represented on line 2 in the example: the {\tt heartbeat} key indicates that the next value is the network port through which the gameserver can be queried and the {\tt gamename} key indicates that the following value is an acronym or shorthand for the game title. An example of how the secure challenge and response would appear is seen at lines 3 and 4. The minimum requirement for a heartbeat is an empty UDP packet. This conveys the IP-address of the gameserver. A masterserver specifically developed to support this single game title can automatically generate the default network port and game title. However, this means that the gameserver can not be serviced on another network port and that the masterserver is limited to serving a client list \emph{only} for this specific game title. -In order to support different network ports, a heartbeat must contain a network port (as seen in example \ref{ls:gs0prot}, line 0). A masterserver that supports multiple game titles also requires an additional key {\tt gamename}. The gamename is, as mentioned before, a unique identifier for the game title and allows the masterserver to identify which game is being serviced and authenticated\footnote{The game title and \emph{gamename} both refer to the original publications from game developers. As per the protocol, we use the word ``gamename'' to refer to these titles from now on. This term returns in chapter \ref{chap:serverlist} and \ref{chap:status}}. +In order to support different network ports, a heartbeat must contain a network port (as seen in example \ref{ls:gs0prot}, line 0). A masterserver that supports multiple game titles also requires an additional key {\tt gamename}. The gamename is, as mentioned before, a unique identifier for the game title and allows the masterserver to identify which game is being serviced and authenticated\footnote{The game title and \emph{gamename} both refer to the original publications from game developers. As per the protocol, we use the word ``gamename'' to refer to these titles from now on. This term returns in chapter \ref{chap:serverlist} and \ref{chap:status}.}. Additional information is often incorporated in the heartbeat as well. Some developers allow the indication of a new session through the {\tt statechanged} keyword, that could be used to indicate to the masterserver that a new session or map has been started. An overview of the protocol is added in appendix \ref{app:protref}. \section{Practical execution} -In the past fifteen years, we have seen many different ways of formatting a heartbeat. It is worth noting that many game developers deviate from the specified protocol. Some games like \emph{Vietcong}, published by \emph{Gathering of Developers} in 2003, do not specify a {\tt gamename} in their heartbeat, which does not make it possible to support the game on a masterserver for multiple gamenames. +In the past fifteen years, we have seen many different ways of formatting a heartbeat. It is worth noting that many game developers deviate from the specified protocol. Some games like \emph{Vietcong}, published by \emph{Gathering of Developers} in 2003, do not specify a gamename in their heartbeat, which does not make it possible to support the game on a masterserver for multiple gamenames. -Another game, \emph{Jetfighter IV: Fortress America} published by \emph{TalonSoft} in 2000, was originally developed with a single masterserver in mind, but did not follow protocol. The gameserver specifies the gamename \emph{jetfighter4} whereas the client specifies the gamename \emph{Jet Fighter IV} for the same game. +Another game, \emph{Jetfighter IV: Fortress America} published by \emph{TalonSoft} in 2000, was originally developed with a single masterserver in mind, but did not follow protocol. The gameserver specifies the gamename {\tt jetfighter4} whereas the client specifies the gamename {\tt Jet Fighter IV} for the same game. These inconsistencies and/or deviations from the original protocol introduce unexpected obstacles in the development process of a replacement masterserver. diff --git a/src/body/serverlist.tex b/src/body/serverlist.tex index d7c0a64..5b17f4c 100755 --- a/src/body/serverlist.tex +++ b/src/body/serverlist.tex @@ -3,9 +3,9 @@ introduction how game clients (``players'') get their list of servers. \begin{figure}[h] - \centering - \includegraphics[width=\textwidth]{img/overview-cms} - \caption{Focus on interaction between client and masterserver }\label{fig:overviewcms} +\centering +\input{tikz/overview-cms} +\caption{Focus on interaction between client and masterserver }\label{fig:overviewcms} \end{figure} interaction, secure/validate, requests, TCP @@ -14,7 +14,8 @@ procedure. \begin{figure}[H] - \centering - \includegraphics[width=\textwidth]{img/client-exchange} - \caption{Interaction between client and masterserver over time.}\label{fig:client} +\centering +\input{tikz/client-exchange} +\caption{TCP interaction between the masterserver (left) and game client (right) over time.} +\label{fig:client} \end{figure} diff --git a/src/body/status.tex b/src/body/status.tex index be0f264..133cb05 100755 --- a/src/body/status.tex +++ b/src/body/status.tex @@ -4,14 +4,15 @@ client-gameserver interaction. status, info, rules, relevant information, what purpose does it serve, etc\cite{oldunreal1}. \begin{figure}[h] - \centering - \includegraphics[width=\textwidth]{img/overview-cgs} - \caption{Focus on interaction between client and gameserver}\label{fig:overviewcgs} +\centering +\input{tikz/overview-cgs} +\caption{Focus on interaction between client and gameserver}\label{fig:overviewcgs} \end{figure} \begin{figure}[H] - \centering - \includegraphics[width=\textwidth]{img/status-exchange} - \caption{Interaction between client and gameserver over time.}\label{fig:status} +\centering +\input{tikz/status-exchange} +\caption{UDP interaction between the game client (left) and gameserver (right) over time.} +\label{fig:status} \end{figure} diff --git a/src/doc.tex b/src/doc.tex index 57847e9..a2431e7 100755 --- a/src/doc.tex +++ b/src/doc.tex @@ -25,6 +25,7 @@ \input{body/credits} \begin{appendices} \input{appendices/usermanual} +\input{appendices/issues} \input{appendices/protocolreference} \input{appendices/gameoverview} \end{appendices} diff --git a/src/img/client-exchange.png b/src/img/client-exchange.png Binary files differdeleted file mode 100644 index 24820aa..0000000 --- a/src/img/client-exchange.png +++ /dev/null diff --git a/src/img/general-overview.png b/src/img/general-overview.png Binary files differdeleted file mode 100644 index 5ed8cc2..0000000 --- a/src/img/general-overview.png +++ /dev/null diff --git a/src/img/heartbeat-exchange.png b/src/img/heartbeat-exchange.png Binary files differdeleted file mode 100644 index 9936a3d..0000000 --- a/src/img/heartbeat-exchange.png +++ /dev/null diff --git a/src/img/overview-cgs.png b/src/img/overview-cgs.png Binary files differdeleted file mode 100644 index 3809c69..0000000 --- a/src/img/overview-cgs.png +++ /dev/null diff --git a/src/img/overview-cms.png b/src/img/overview-cms.png Binary files differdeleted file mode 100644 index b832d5c..0000000 --- a/src/img/overview-cms.png +++ /dev/null diff --git a/src/img/overview-hb.png b/src/img/overview-hb.png Binary files differdeleted file mode 100644 index a3a3b08..0000000 --- a/src/img/overview-hb.png +++ /dev/null diff --git a/src/img/status-exchange.png b/src/img/status-exchange.png Binary files differdeleted file mode 100644 index fc339f0..0000000 --- a/src/img/status-exchange.png +++ /dev/null diff --git a/src/layout/headers.tex b/src/layout/headers.tex index 73271d1..88709cb 100755 --- a/src/layout/headers.tex +++ b/src/layout/headers.tex @@ -31,7 +31,7 @@ \title{333networks masterserver technical reference} \author{Darkelarious} -\usetikzlibrary{shapes,arrows,plotmarks,shapes.multipart,calc} +\usetikzlibrary{shapes,arrows,angles, calc} \simplechapter @@ -63,3 +63,40 @@ filecolor=darkgray, urlcolor=blue } + +\definecolor{gray}{rgb}{0.5,0.5,0.5} +\definecolor{lightgray}{rgb}{0.95,0.95,0.95} +\definecolor{darkgray}{rgb}{.3,.3,.3} + + +\lstset{ + basicstyle=\footnotesize, % the size of the fonts that are used for the code + numbers=left, % where to put the line-numbers + numberstyle=\color{gray}, % the style that is used for the line-numbers + stepnumber=1, % the step between two line-numbers. If it's 1, each line + % will be numbered + numbersep=10pt, % how far the line-numbers are from the code + backgroundcolor=\color{lightgray}, % choose the background color. You must add \usepackage{color} + %showspaces=false, % show spaces adding particular underscores + %showstringspaces=false, % underline spaces within strings + %showtabs=false, % show tabs within strings adding particular underscores + frame=tb, % lines above and below + %rulecolor=\color{gray}, % colored in a slightly darker gray + %framesep=3pt, + %tabsize=2, % sets default tabsize to 2 spaces + %captionpos=b, % sets the caption-position to bottom + %breaklines=true, % sets automatic line breaking + %breakatwhitespace=true, % sets if automatic breaks should only happen at whitespace + %keywordstyle=\bfseries, % keywords are bold + %emphstyle=\itshape\color{green!30!black}, + %xleftmargin=5pt, + framexleftmargin=1cm, + xleftmargin=4cm, + xrightmargin=4cm, + %keywordstyle=\bfseries\color{green!40!black}, + %commentstyle=\itshape\color{gray!40!black}, + %identifierstyle=\color{black}, + %stringstyle=\color{orange}, + firstnumber=1 +} + diff --git a/src/lst/gs0protocol.txt b/src/lst/gs0protocol.txt index f7ed940..a7052d9 100644 --- a/src/lst/gs0protocol.txt +++ b/src/lst/gs0protocol.txt @@ -1,4 +1,4 @@ -\key\\value +\key\value \heartbeat\7778\gamename\ut \secure\wookie\enctype\0 \validate\2/TYFMRc diff --git a/src/tikz/client-exchange.tex b/src/tikz/client-exchange.tex new file mode 100755 index 0000000..470edc7 --- /dev/null +++ b/src/tikz/client-exchange.tex @@ -0,0 +1,54 @@ +\begin{tikzpicture} + +% figure title +\node[rectangle] at (5, 10.5) (title) {\underline{\bf TCP serverlist communication}}; + +% ms and gc, top +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at (0, 10.0) (mstop) {\bf masterserver}; +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at (10, 10.0) (gctop) {\bf game client}; + +% open connection +\node at (10, 9.5) (gcoc) {}; +\node at ( 0, 8.5) (msoc) {}; +\node at (-1, 9.0) (mslisten) [text width=2cm, text centered]{listening for\\connections}; +\draw[->] (gcoc) -- (msoc) node[midway, above, sloped] {open TCP connection}; + +% secure +\node at ( 0, 8.0) (msse) {}; +\node at (10, 7.0) (gcse) {}; +\node at (11, 7.0) (gcsecure) [text width=2cm,text centered]{calculate unique\\ response}; +\draw[->] (msse) -- (gcse) node[midway, above, sloped] {request basic game info, send ``secure'' string}; + +% validate +\node at (10, 6.5) (gcva) {}; +\node at ( 0, 5.5) (msva) {}; +\node at (-1, 5.5) (msvalidate) [text width=2cm,text centered]{verify\\ response}; +\draw[->] (gcva) -- (msva) node[midway, above, sloped] {send unique response, basic game info (gamename)}; + +% list request +\node at (10, 5.0) (gcli) {}; +\node at ( 0, 4.0) (msli) {}; +\node at (-1, 4.0) (mslist) [text width=2cm, text centered]{if verified, compile list}; +\draw[->] (gcli) -- (msli) node[midway, above, sloped] {request list and format (plain/compressed)}; + +\node at ( 0, 3.5) (msl1) {}; +\node at (10, 2.5) (gcl1) {}; +\draw[->] (msl1) -- (gcl1) node[midway, above, sloped] {list of addresses (ip:port)}; + +\node at ( 0, 3.2) (msl2) {}; +\node at (10, 2.2) (gcl2) {}; +\node at (11, 2.0) (gcparse) [text width=2cm, text centered]{parse\\address\\list}; +\draw[->] (msl2) -- (gcl2) node[midway, below, sloped] {(in multiple packets)}; + +% close connection +\node at ( 0, 1.7) (mscc) {}; +\node at (10, 0.7) (gccc) {}; +\draw[->] (mscc) -- (gccc) node[midway, above, sloped] {close connection}; + +% ms and gc, bottom, vertical lines +\node at ( 0, 0) (msbot) {}; +\node at (10, 0.0) (gcbot) {}; +\draw[->] (mstop.270) -- (msbot.90) node[at end, xshift=-0.2cm, yshift=0.5cm, rotate=90] {time}; +\draw (gctop.270) -- (gcbot.90) {}; + +\end{tikzpicture} diff --git a/src/tikz/heartbeat-exchange.tex b/src/tikz/heartbeat-exchange.tex new file mode 100755 index 0000000..dd45a19 --- /dev/null +++ b/src/tikz/heartbeat-exchange.tex @@ -0,0 +1,34 @@ +\begin{tikzpicture} + +% figure title +\node[rectangle] at (5, 6) (title) {\underline{\bf UDP heartbeat communication}}; + +% gameserver and masterserver +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at ( 0, 5.5) (gstop) {\bf gameserver}; +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at (10, 5.5) (mstop) {\bf masterserver}; + +% heartbeat +\node at ( 0, 5) (gshb) {}; +\node at (10, 4) (mshb) {}; +\node at (11, 4) (mssecure) [text width=2cm,text centered]{challenge\\sender}; +\draw[->] (gshb) -- (mshb) node[midway, above, sloped] {send heartbeat: port, gamename}; + +% secure challenge +\node at (10, 3.5) (msse) {}; +\node at ( 0, 2.5) (gsse) {}; +\node at (-1, 2.5) (msvalidate) [text width=2cm,text centered]{calculate\\``validate''\\response}; +\draw[->] (msse) -- (gsse) node[midway, above, sloped] {challenge with ``secure'' string, request basic game info}; + +% validate +\node at ( 0, 2) (gsva) {}; +\node at (10, 1) (msva) {}; +\node at (11.6, 1) (mscmp) [text width=3cm, text centered]{check response and add server to list}; +\draw[->] (gsva) -- (msva) node[midway, above, sloped] {send ``validate'' response, gamename, game version}; + +% gameserver and masterserver bottom, vertical lines +\node at ( 0, 0) (gsbot) {}; +\node at (10, 0) (msbot) {}; +\draw[->] (gstop.270) -- (gsbot.90) node[at end, xshift=-0.2cm, yshift=0.5cm, rotate=90] {time}; +\draw (mstop.270) -- (msbot.90) {}; + +\end{tikzpicture} diff --git a/src/tikz/overview-cgs.tex b/src/tikz/overview-cgs.tex new file mode 100755 index 0000000..dd2d161 --- /dev/null +++ b/src/tikz/overview-cgs.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + +\tikzset{drawbox/.style={draw, rectangle, minimum height=1cm, minimum width=3cm}} +\tikzset{drawline/.style={midway, sloped, text width=2cm, text centered}} + +% figure title +\node[rectangle] at (5, 1) (title) {\underline{\bf Infrastructure overview}}; + +% gameserver, masterserver, game client +\node[drawbox] at ( 0, 0) (gs) {\bf gameserver}; +\node[drawbox, black!40] at (10, -2) (ms) {\bf masterserver}; +\node[drawbox] at ( 2, -4) (gc) {\bf game client}; + +% interactions +\draw[black!40] (gs) -- (ms) node[drawline] {(1) UDP\\heartbeat}; +\draw[black!40] (gc) -- (ms) node[drawline] {(2) TCP\\list request}; +\draw (gc) -- (gs) node[drawline, rotate=90, left, align=right] {(3) UDP\\status request}; + + +\end{tikzpicture} diff --git a/src/tikz/overview-cms.tex b/src/tikz/overview-cms.tex new file mode 100755 index 0000000..d6bf8b8 --- /dev/null +++ b/src/tikz/overview-cms.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + +\tikzset{drawbox/.style={draw, rectangle, minimum height=1cm, minimum width=3cm}} +\tikzset{drawline/.style={midway, sloped, text width=2cm, text centered}} + +% figure title +\node[rectangle] at (5, 1) (title) {\underline{\bf Infrastructure overview}}; + +% gameserver, masterserver, game client +\node[drawbox, black!40] at ( 0, 0) (gs) {\bf gameserver}; +\node[drawbox] at (10, -2) (ms) {\bf masterserver}; +\node[drawbox] at ( 2, -4) (gc) {\bf game client}; + +% interactions +\draw[black!40] (gs) -- (ms) node[drawline] {(1) UDP\\heartbeat}; +\draw (gc) -- (ms) node[drawline] {(2) TCP\\list request}; +\draw[black!40] (gc) -- (gs) node[drawline, rotate=90, left, align=right] {(3) UDP\\status request}; + + +\end{tikzpicture} diff --git a/src/tikz/overview-hb.tex b/src/tikz/overview-hb.tex new file mode 100755 index 0000000..cf306ca --- /dev/null +++ b/src/tikz/overview-hb.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + +\tikzset{drawbox/.style={draw, rectangle, minimum height=1cm, minimum width=3cm}} +\tikzset{drawline/.style={midway, sloped, text width=2cm, text centered}} + +% figure title +\node[rectangle] at (5, 1) (title) {\underline{\bf Infrastructure overview}}; + +% gameserver, masterserver, game client +\node[drawbox] at ( 0, 0) (gs) {\bf gameserver}; +\node[drawbox] at (10, -2) (ms) {\bf masterserver}; +\node[drawbox, black!40] at ( 2, -4) (gc) {\bf game client}; + +% interactions +\draw (gs) -- (ms) node[drawline] {(1) UDP\\heartbeat}; +\draw[black!40] (gc) -- (ms) node[drawline] {(2) TCP\\list request}; +\draw[black!40] (gc) -- (gs) node[drawline, rotate=90, left, align=right] {(3) UDP\\status request}; + + +\end{tikzpicture} diff --git a/src/tikz/overview.tex b/src/tikz/overview.tex new file mode 100755 index 0000000..ac0bbf8 --- /dev/null +++ b/src/tikz/overview.tex @@ -0,0 +1,20 @@ +\begin{tikzpicture} + +\tikzset{drawbox/.style={draw, rectangle, minimum height=1cm, minimum width=3cm}} +\tikzset{drawline/.style={midway, sloped, text width=2cm, text centered}} + +% figure title +\node[rectangle] at (5, 1) (title) {\underline{\bf Infrastructure overview}}; + +% gameserver, masterserver, game client +\node[drawbox] at ( 0, 0) (gs) {\bf gameserver}; +\node[drawbox] at (10, -2) (ms) {\bf masterserver}; +\node[drawbox] at ( 2, -4) (gc) {\bf game client}; + +% interactions +\draw (gs) -- (ms) node[drawline] {(1) UDP\\heartbeat}; +\draw (gc) -- (ms) node[drawline] {(2) TCP\\list request}; +\draw (gc) -- (gs) node[drawline, rotate=90, left, align=right] {(3) UDP\\status request}; + + +\end{tikzpicture} diff --git a/src/tikz/status-exchange.tex b/src/tikz/status-exchange.tex new file mode 100755 index 0000000..159c762 --- /dev/null +++ b/src/tikz/status-exchange.tex @@ -0,0 +1,47 @@ +\begin{tikzpicture} + +% figure title +\node[rectangle] at (5, 6) (title) {\underline{\bf UDP status communication}}; + +% game client and gameserver +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at ( 0, 5.5) (gctop) {\bf game client}; +\node[draw, rectangle, minimum height=0.6cm, minimum width=2.7cm] at (10, 5.5) (gstop) {\bf gameserver}; + +% status +\node at ( 0, 5.0) (gcrq) {}; +\node at (10, 4.0) (gsrq) {}; +\draw[->] (gcrq) -- (gsrq) node[midway, above, sloped] {status request}; + +% basic +\node at (10, 3.5) (gsba) {}; +\node at ( 0, 2.5) (gcba) {}; +\draw[->] (gsba) -- (gcba) node[midway, above, sloped] {``basic'' response}; + +% info +\node at (10, 3.0) (gsin) {}; +\node at ( 0, 2.0) (gcin) {}; +\draw[->] (gsin) -- (gcin) node[midway, above, sloped] {``info'' response}; + +% rules +\node at (10, 2.5) (gsru) {}; +\node at ( 0, 1.5) (gcru) {}; +\draw[->] (gsru) -- (gcru) node[midway, above, sloped] {``rules'' response}; + +% players +\node at (10, 2.0) (gspl) {}; +\node at ( 0, 1.0) (gcpl) {}; +\draw[->] (gspl) -- (gcpl) node[midway, above, sloped] {``players'' response}; + +% multiple packets +\node at (10, 1.85) (gspl2) {}; +\node at ( 0, 0.85) (gcpl2) {}; +\draw[->] (gspl2) -- (gcpl2) {}; + + +% gameserver and masterserver bottom, vertical lines +\node at ( 0, 0) (gcbot) {}; +\node at (10, 0) (gsbot) {}; +\draw[->] (gctop.270) -- (gcbot.90) node[at end, xshift=-0.2cm, yshift=0.5cm, rotate=90] {time}; +\draw (gstop.270) -- (gsbot.90) {}; + +\end{tikzpicture} |
