Skip to content

Commit

Permalink
fix proxy_setip.patch
Browse files Browse the repository at this point in the history
closes #52
  • Loading branch information
sauerbraten committed Mar 24, 2022
1 parent 956ee7a commit f484218
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patches/proxy_setip.patch
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ index 3017f57..4aa8d18 100644
-uint getclientip(int n) { return clients.inrange(n) && clients[n]->type==ST_TCPIP ? clients[n]->peer->address.host : 0; }
+uint getclientip(int n)
+{
+ if(!clients.inrange(n) || clients[n]->type==ST_TCPIP) return 0;
+ if(!clients.inrange(n) || clients[n]->type!=ST_TCPIP) return 0;
+ return clients[n]->real.host ? clients[n]->real.host : clients[n]->peer->address.host;
+}
+int setclientrealip(int n, uint ip)
Expand Down
2 changes: 1 addition & 1 deletion src/engine/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ ENetPeer *getclientpeer(int i) { return clients.inrange(i) && clients[i]->type==
int getnumclients() { return clients.length(); }
uint getclientip(int n)
{
if(!clients.inrange(n) || clients[n]->type==ST_TCPIP) return 0;
if(!clients.inrange(n) || clients[n]->type!=ST_TCPIP) return 0;
return clients[n]->real.host ? clients[n]->real.host : clients[n]->peer->address.host;
}
int setclientrealip(int n, uint ip)
Expand Down

0 comments on commit f484218

Please sign in to comment.