Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH's 1.3/OfficialCurrentGPP protocol (71) #12

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apelsin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Category: Network
Synopsis: Server and community browser for the game Tremulous
Description:
A gtk2hs server and clan browser for the open source game Tremulous
<http://tremulous.net>. Both Tremulous 1.1 and GPP are supported.
<http://tremulous.net>. Both Tremulous 1.1, GPP and 1.3 (protocol 71)
are supported. Unvanquished is included as an extra (Protocol 86)

Features filtering, player search, a list of online clan members,
a clan list and basic perferences.
Expand Down
1 change: 1 addition & 0 deletions packages/pacman/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ depends=('gmp' 'gtk2' 'hicolor-icon-theme')

optdepends=('tremulous: Launch Tremulous 1.1 games'
'tremulous-gpp: Launch Tremulous GPP games'
'tremulous-1.3: Launch Tremulous 1.3 games'
'unvanquished: Launch Unvanquished games')


Expand Down
4 changes: 4 additions & 0 deletions src/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data Config = Config
, clanlistURL :: !String
, tremulousPath
, tremulousGppPath
, tremulous13Path
, unvanquishedPath :: !String
, refreshMode :: !RefreshMode
, autoClan
Expand All @@ -61,17 +62,20 @@ defaultConfig :: Config
defaultConfig = Config
{ masterServers = [ ("master.tremulous.net", 30710, 69)
, ("master.tremulous.net", 30700, 70)
, ("master.tremulous.net", 30700, 71)
, ("unvanquished.net", 27950, 86)
]
, clanlistURL = "http://ddos-tremulous.eu/cw/api/2/clanlist"

#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
, tremulousPath = "C:\\Program Files\\Tremulous\\tremulous.exe"
, tremulousGppPath = "C:\\Program Files\\Tremulous\\tremulous-gpp.exe"
, tremulous13Path = "C:\\Program Files\\Tremulous\\tremulous.exe"
, unvanquishedPath = "C:\\Program Files (x86)\\Unvanquished\\daemon.exe"
#else
, tremulousPath = "tremulous"
, tremulousGppPath = "tremulous-gpp"
, tremulous13Path = "tremulous"
, unvanquishedPath = "unvanquished"
#endif

Expand Down
4 changes: 3 additions & 1 deletion src/Preferences.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ newPreferences Bundle{..} = do
path_table <- paddedTableNew
tremulousPath <- pathInsertTable parent path_table 0 "_Tremulous 1.1:"
tremulousGppPath <- pathInsertTable parent path_table 1 "Tremulous _GPP:"
unvanquishedPath <- pathInsertTable parent path_table 2 "_Unvanquished:"
tremulous13Path <- pathInsertTable parent path_table 2 "Tremulous _1.3:"
unvanquishedPath <- pathInsertTable parent path_table 3 "_Unvanquished:"
paths <- framed "Path or command" path_table

-- Startup
Expand Down Expand Up @@ -116,6 +117,7 @@ newPreferences Bundle{..} = do
set showEmpty [ toggleButtonActive := C.showEmpty c]
set tremulousPath [ entryText := C.tremulousPath c ]
set tremulousGppPath [ entryText := C.tremulousGppPath c]
set tremulous13Path [ entryText := C.tremulous13Path c]
set unvanquishedPath [ entryText := C.unvanquishedPath c]
set autoClan [ toggleButtonActive := C.autoClan c]
set restoreGeometry [ toggleButtonActive := C.restoreGeometry c]
Expand Down
1 change: 1 addition & 0 deletions src/ServerInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ protocolToPath :: Config -> Int -> Maybe FilePath
protocolToPath c proto = case proto of
69 -> Just (tremulousPath c)
70 -> Just (tremulousGppPath c)
71 -> Just (tremulous13path c)
86 -> Just (unvanquishedPath c)
_ -> Nothing

Expand Down
4 changes: 3 additions & 1 deletion src/TremFormatting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ protoToAbbr, protoToFull :: IsString s => Int -> s
protoToAbbr x = case x of
69 -> "1.1"
70 -> "gpp"
71 -> "1.3"
86 -> "unv"
_ -> "?"

protoToFull x = case x of
69 -> "Tremulous 1.1"
70 -> "Tremulous GPP"
71 -> "Tremulous 1.3"
86 -> "Unvanquished"
_ -> "<Unknown>"
_ -> "<Unknown>"