Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vlad Doc
SRB2
Commits
2308441e
Commit
2308441e
authored
9 years ago
by
Yukita Mayako
Browse files
Options
Downloads
Patches
Plain Diff
Fix client connection-failed crash.
parent
1ee2b465
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/d_clisrv.c
+8
-4
8 additions, 4 deletions
src/d_clisrv.c
src/d_enet.c
+6
-4
6 additions, 4 deletions
src/d_enet.c
with
14 additions
and
8 deletions
src/d_clisrv.c
+
8
−
4
View file @
2308441e
...
...
@@ -897,8 +897,7 @@ static void CL_ConnectToServer(boolean viams)
cl_mode
=
cl_askjoin
;
// don't break case continue to cljoin request now
case
cl_askjoin
:
if
(
!
server
)
// the server already has their files loaded, duh!
CL_LoadServerFiles
();
//CL_LoadServerFiles();
if
(
CL_SendJoin
())
// Send join request, server instantly connects.
cl_mode
=
server
?
cl_connected
:
cl_waitjoinresponse
;
break
;
...
...
@@ -1070,10 +1069,15 @@ static void Command_connect(void)
}
else
{
boolean
success
=
false
;
if
(
COM_Argc
()
>=
3
)
D_NetConnect
(
COM_Argv
(
1
),
COM_Argv
(
2
));
success
=
D_NetConnect
(
COM_Argv
(
1
),
COM_Argv
(
2
));
else
D_NetConnect
(
COM_Argv
(
1
),
NULL
);
success
=
D_NetConnect
(
COM_Argv
(
1
),
NULL
);
if
(
!
success
)
{
M_StartMessage
(
M_GetText
(
"Failed to connect to server.
\n\n
Press ESC
\n
"
),
NULL
,
MM_NOTHING
);
return
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/d_enet.c
+
6
−
4
View file @
2308441e
...
...
@@ -225,7 +225,7 @@ void D_NetOpen(void)
net_playercount
=
0
;
}
void
D_NetConnect
(
const
char
*
hostname
,
const
char
*
port
)
boolean
D_NetConnect
(
const
char
*
hostname
,
const
char
*
port
)
{
ENetAddress
address
;
ENetEvent
e
;
...
...
@@ -250,10 +250,12 @@ void D_NetConnect(const char *hostname, const char *port)
if
(
enet_host_service
(
ClientHost
,
&
e
,
5000
)
>
0
&&
e
.
type
==
ENET_EVENT_TYPE_CONNECT
)
{
CONS_Printf
(
"Connection successful!"
);
return
;
CONS_Printf
(
"
NETWORK:
Connection successful!"
);
return
true
;
}
M_StartMessage
(
M_GetText
(
"Failed to connect to server.
\n\n
Press ESC
\n
"
),
NULL
,
MM_NOTHING
);
enet_host_destroy
(
ClientHost
);
ClientHost
=
NULL
;
return
false
;
}
// Initialize network.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment