client.console: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "{{ScriptItem |endpoint = shared |type = property |class = Client |name = console |returnTypes = bool |readonly = true |usage = fetch the status of whether the client is the ho...")
 
No edit summary
 
Line 6: Line 6:
|returnTypes = bool
|returnTypes = bool
|readonly = true
|readonly = true
|usage = fetch the status of whether the client is the host of the peer2peer server
|usage = fetch the status of whether the client is the server console
|returnInfo = the status of whether the client is the host of the peer2peer server
|returnInfo = the status of whether the client is server console
|exampleJSSS = addCommandHandler("test", function(command, params, client) {
  if(client.console == true) {
    // This command was used by the server console
  }
});
|notes = Due to the universal design of the server and client (internally called "net machines"), the server itself ''is'' a client. Since the server window/console accepts input, this property is available to check if the client is indeed the server. This is useful if you want to make a command only usable by the server console. Just add a command handler, and a simple check if the command was typed into the server console (instead of a player using the chatbox). See example on this page. It also works anywhere you want to check if a client object is the server.
}}
}}
2,711

edits

Navigation menu