ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:isserver

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
functions:isserver [2017/03/17 22:36] – created korshunfunctions:isserver [2017/06/19 21:16] korshun
Line 17: Line 17:
  
 <note important>**All** players are both servers and clients in **(G)ZDoom multiplayer**, which is not client-server.</note> <note important>**All** players are both servers and clients in **(G)ZDoom multiplayer**, which is not client-server.</note>
 +
 +<note warning>''!IsClient()'' is **not** equivalent to ''IsServer()''. Both can be true.</note>
  
 ===== Examples ===== ===== Examples =====
Line 29: Line 31:
     // Draw hud, spawn effects.     // Draw hud, spawn effects.
 } }
 +</code>
 +
 +Use it to verify that serverside code is not run clientside, while not breaking singleplayer:
 +<code>
 +if (!IsServer())
 +    error("This function must not be called clientside"); // does not warn in singleplayer
 </code> </code>