ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


client_server_detection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
client_server_detection [2019/09/05 23:45] – [How it works] korshunclient_server_detection [2019/09/05 23:46] – [How it works] korshun
Line 52: Line 52:
 ''IsClient()'' simply checks if [[zdoom>ConsolePlayerNumber]] is not negative. ''IsClient()'' simply checks if [[zdoom>ConsolePlayerNumber]] is not negative.
  
-''IsServer()'' is more complicated. It returns true if [[zdoom>ConsolePlayerNumber]] is negative. But if it's not negative, it needs to distinguish between multiplayer emulation and real multiplayer. The function needs to return true in multiplayer emulation but false in real multiplayer. +''IsServer()'' is more complicated. It returns true if [[zdoom>ConsolePlayerNumber]] is negative. But if it's not negative, it needs to distinguish between multiplayer emulation and real multiplayer. It checks if the multiplayer is real using [[zan>IsNetworkGame]]. But calling this function in ZDoom/GZDoom crashes the engine. Therefore, before calling ''IsNetworkGame'', it checks if the engine is Zandronum using [[source_port_detection|IsZandronum]].
- +
-It checks if the multiplayer is real using [[zan>IsNetworkGame]]. But calling this function in ZDoom/GZDoom crashes the engine. Therefore, before calling ''IsNetworkGame'', it checks if the engine is Zandronum using [[source_port_detection|IsZandronum]].+
  
 If the engine is not Zandronum, the function returns true, because in ZDoom/GZDoom all players run gameplay code. If the engine is not Zandronum, the function returns true, because in ZDoom/GZDoom all players run gameplay code.
client_server_detection.txt · Last modified: 2019/09/05 23:54 by korshun