Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
openjazz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
openjazz
Commits
5421b4d6
Commit
5421b4d6
authored
Feb 18, 2010
by
alistert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made networking optional at compile time.
parent
943294c8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
383 additions
and
335 deletions
+383
-335
network.cpp
src/io/network.cpp
+359
-321
network.h
src/io/network.h
+9
-7
main.cpp
src/main.cpp
+8
-6
mainmenu.cpp
src/menu/mainmenu.cpp
+7
-1
No files found.
src/io/network.cpp
View file @
5421b4d6
This diff is collapsed.
Click to expand it.
src/io/network.h
View file @
5421b4d6
...
...
@@ -8,7 +8,7 @@
* Part of the OpenJazz project
*
*
* Copyright (c) 2005-20
09
Alister Thomson
* Copyright (c) 2005-20
10
Alister Thomson
*
* OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0
...
...
@@ -24,6 +24,7 @@
#include "OpenJazz.h"
#ifdef USE_SDL_NET
#include <SDL_net.h>
#endif
...
...
@@ -46,6 +47,13 @@
class
Network
{
public
:
#ifdef USE_SDL_NET
TCPsocket
socket
;
TCPsocket
clientSocket
;
IPaddress
ipAddress
;
SDLNet_SocketSet
socketset
;
#endif
Network
();
~
Network
();
...
...
@@ -57,12 +65,6 @@ class Network {
int
recv
(
int
sock
,
unsigned
char
*
buffer
,
int
length
);
bool
isConnected
(
int
sock
);
int
getError
();
#ifdef USE_SDL_NET
TCPsocket
socket
;
TCPsocket
clientSocket
;
IPaddress
ipAddress
;
SDLNet_SocketSet
socketset
;
#endif
};
...
...
src/main.cpp
View file @
5421b4d6
...
...
@@ -63,18 +63,20 @@ int loadMain (int argc, char *argv[]) {
// Determine paths
// Use
the hard-coded path
, if available
// Use
hard-coded paths
, if available
#ifdef DATAPATH
firstPath
=
new
Path
(
NULL
,
createString
(
DATAPATH
));
#elseifdef __SYMBIAN32__
#else
firstPath
=
NULL
;
#endif
#ifdef __SYMBIAN32__
#ifdef UIQ3
firstPath
=
new
Path
(
NULL
,
createString
(
"c:
\\
shared
\\
openjazz
\\
"
));
firstPath
=
new
Path
(
firstPath
,
createString
(
"c:
\\
shared
\\
openjazz
\\
"
));
#else
firstPath
=
new
Path
(
NULL
,
createString
(
"c:
\\
data
\\
openjazz
\\
"
));
firstPath
=
new
Path
(
firstPath
,
createString
(
"c:
\\
data
\\
openjazz
\\
"
));
#endif
#else
firstPath
=
NULL
;
#endif
...
...
src/menu/mainmenu.cpp
View file @
5421b4d6
...
...
@@ -40,13 +40,15 @@
int
Menu
::
main
()
{
#if (defined USE_SOCKETS) || (defined USE_SDL_NET)
const
char
*
newGameOptions
[
6
]
=
{
"new single player game"
,
"new co-op game"
,
"new battle"
,
"new team battle"
,
"new race"
,
"join game"
};
int
ret
;
#endif
Scene
*
scene
;
SDL_Rect
src
,
dst
;
int
option
,
suboption
;
unsigned
int
idleTime
;
int
ret
;
option
=
suboption
=
0
;
...
...
@@ -73,6 +75,7 @@ int Menu::main () {
case
0
:
// New game
#if (defined USE_SOCKETS) || (defined USE_SDL_NET)
while
(
true
)
{
ret
=
generic
(
newGameOptions
,
6
,
&
suboption
);
...
...
@@ -92,6 +95,9 @@ int Menu::main () {
}
}
#else
if
(
newGameEpisode
(
suboption
)
==
E_QUIT
)
return
E_QUIT
;
#endif
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment