User Tools

Site Tools


en:suckerserv:functions

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:suckerserv:functions [2011/06/23 20:45]
piernov
en:suckerserv:functions [2014/05/31 00:27] (current)
Line 25: Line 25:
 | server.player_shots(cn) ​       | number ​      ​| ​                                                                                                                                                                | | server.player_shots(cn) ​       | number ​      ​| ​                                                                                                                                                                |
 | server.player_accuracy(cn) ​    | number ​      | Calculated from shots and misses. Note: game client uses different calculation method which maybe noticeable in game modes such as ffa or efficiency. ​          | | server.player_accuracy(cn) ​    | number ​      | Calculated from shots and misses. Note: game client uses different calculation method which maybe noticeable in game modes such as ffa or efficiency. ​          |
 +| server.player_accuracy2(cn) ​   | number ​      | Calculated from damage and damagewasted. Client calculation method, used in awards/​best_stats and stats modules. ​                                               |
 | server.player_timeplayed(cn) ​  | number ​      | Number of seconds played in the current game.                                                                                                                   | | server.player_timeplayed(cn) ​  | number ​      | Number of seconds played in the current game.                                                                                                                   |
 | server.player_win(cn) ​         | number ​      | Returns 1 or 0 for win or lose, respectively. In singles mode, a winner is a player with the most frags. In team mode, winners are players on the winning team. | | server.player_win(cn) ​         | number ​      | Returns 1 or 0 for win or lose, respectively. In singles mode, a winner is a player with the most frags. In team mode, winners are players on the winning team. |
 | server.player_rank(cn) ​        | number ​      | Player'​s rank calculated at the end of the game. For team games, rank is relative to team members. ​                                                             | | server.player_rank(cn) ​        | number ​      | Player'​s rank calculated at the end of the game. For team games, rank is relative to team members. ​                                                             |
 +| server.player_armour(cn) ​      | number ​      ​| ​                                                                                                                                                                |
 +| server.player_armour_type(cn) ​ | number ​      ​| ​                                                                                                                                                                |
 +
 +
  
 ==== Connection Stats ==== ==== Connection Stats ====
Line 35: Line 40:
 | server.player_connection_time(cn) | number ​      | Number of seconds connected to the server. ​                                               | | server.player_connection_time(cn) | number ​      | Number of seconds connected to the server. ​                                               |
 | server.player_ping(cn) ​           | number ​      | Returns the last reported ping value. ​                                                    | | server.player_ping(cn) ​           | number ​      | Returns the last reported ping value. ​                                                    |
-| server.player_lag(cn) ​            | number ​      | Get the player'​s lag value measured as the time delay between receiving position updates. | +| server.player_lag(cn) ​            | number ​      | Get the player'​s lag value measured as the time delay between receiving position updates. |                                                                          
 ==== Current Status ==== ==== Current Status ====
  
Line 57: Line 61:
 | server.player_msg(cn,​ text) | nil | Send a server message to a player.| | server.player_msg(cn,​ text) | nil | Send a server message to a player.|
 | server.player_slay(cn) | nil | Kill a player; their stats aren't affected.| | server.player_slay(cn) | nil | Kill a player; their stats aren't affected.|
-| server.player_suicide(cn) | nil || +| server.player_suicide(cn) | nil | Force a player to suicide, which will affect their game stats. |
-| server.player_priv_code(cn) | nil | Force a player to suicide, which will affect their game stats.|+
 | server.changeteam(cn,​ team) | boolean | Move a player to another team.| | server.changeteam(cn,​ team) | boolean | Move a player to another team.|
 | server.kick(cn,​[bantime],​[admin],​[reason]) | nil | Kick and ban a player from the server. Argument defaults: bantime=4 hours, admin="​server",​ reason=""​.| | server.kick(cn,​[bantime],​[admin],​[reason]) | nil | Kick and ban a player from the server. Argument defaults: bantime=4 hours, admin="​server",​ reason=""​.|
Line 70: Line 73:
 | server.setadmin(cn) | nil | Give a player admin privilege. Note: only 1 visible master/​admin is supported.| | server.setadmin(cn) | nil | Give a player admin privilege. Note: only 1 visible master/​admin is supported.|
 | server.unsetmaster() | nil | Take away master privilege from the current master.| | server.unsetmaster() | nil | Take away master privilege from the current master.|
-| server.set_invadmin(cn) | nil | Give player admin status, but is invisible to other players.| +| server.set_invisible_admin(cn) | nil | Give player admin status, but is invisible to other players.| 
-| server.set_invmaster(cn) | nil | Give player master status, but is invisible to other players.|+| server.set_invisible_master(cn) | nil | Give player master status, but is invisible to other players.|
 | server.unsetpriv(cn) | nil | Take away player'​s master or admin privilege. This function should work on all privilege configurations.| | server.unsetpriv(cn) | nil | Take away player'​s master or admin privilege. This function should work on all privilege configurations.|
  
Line 101: Line 104:
 | server.team_win(team) ​        | boolean ​     | Has the highest score of all the teams                                      | | server.team_win(team) ​        | boolean ​     | Has the highest score of all the teams                                      |
 | server.team_draw(team) ​       | boolean ​     | Score is equal to the scores of all the other teams. TODO: remove argument. | | server.team_draw(team) ​       | boolean ​     | Score is equal to the scores of all the other teams. TODO: remove argument. |
 +
 +===== Game Functions =====
 +
 +^ Name and Parameters ​         ^ Description ​                                        ^
 +| pausegame(pause) ​            | Pause or resume game. Argument value must be 1 or 0 |
 +| changetime(milliseconds) ​    | Change time remaining ​                              |
 +| changemap(map,​[mode],​[time]) | Change map                                          |
 +| delbot(cn) ​                  | Remove a bot from the game belonging to a player ​   |
 +
 +===== Server Functions =====
 +
 +^ Name and Parameters ​    ^ Description ​                                                                      ^
 +| restart() ​              | Restart server process at end of the game or immediately if the server is empty. ​ |
 +| restart_now() ​          | Restart server now                                                                |
 +| shutdown() ​             | Shut down server process (which will also terminate the irc bot process) ​         |
 +| reloadscripts() ​        | Reload all the scripts without restarting the server ​                             |
 +| msg(text) ​              | Broadcast message on server ​                                                      |
 +| clearbans() ​            | Clear all temporary bans                                                          |
 +| loadbanlist(filename) ​  ​| ​                                                                                  |
 +| writebanlist(filename) ​ |                                                                                   |
 +| permban(ip) ​            ​| ​                                                                                  |
 +| unsetban(ip) ​           |                                                                                   |
 +| recorddemo(filename) ​   | Immediately start recording the game (no server message is broadcast) ​            |
 +| stopdemo() ​             | Stop recording game                                                               |
 +
 +===== Utility Functions =====
 +
 +^ Name and Parameters ​          ^ Description ​                                    ^
 +| ip_to_country(ip) ​            | Resolve IP address to country ​                  |
 +| ip_to_country_code(ip) ​       | Resolve IP address to a two letter country code |
 +| load_geoip_database(filename) | Resolve ip address to a two letter country code |
 +| gethostbyname(name) ​          | Resolve FQDN to IP address. ​                    |
en/suckerserv/functions.1308854709.txt.bz2 · Last modified: 2014/05/31 00:26 (external edit)