Skip to content

Commit

Permalink
Fixed TCP/IP networking (#3551)
Browse files Browse the repository at this point in the history
Fixes #3550
  • Loading branch information
Loobinex authored Oct 13, 2024
1 parent d702e15 commit 5932f3c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/bflib_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,19 @@ TbError LbNetwork_Create(char *nsname_str, char *plyr_name, unsigned long *plyr_
ERRORLOG("No network SP selected");
return Lb_FAIL;
}

sprintf(buf, "%d", ServerPort);
if (netstate.sp->host(buf, optns) == Lb_FAIL) {
return Lb_FAIL;

if (ServerPort != 0)
{
sprintf(buf, "%d", ServerPort);
if (netstate.sp->host(buf, optns) == Lb_FAIL) {
return Lb_FAIL;
}
}
else
{
if (netstate.sp->host(":5555", optns) == Lb_FAIL) {
return Lb_FAIL;
}
}

netstate.my_id = SERVER_ID;
Expand Down

0 comments on commit 5932f3c

Please sign in to comment.