diff --git a/Makefile b/Makefile index c417d70..2805b9b 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,5 @@ clean: .PHONY: doc doc: - luadoc -d $(doc) mods/spawn_usher + ldoc --dir=$(doc) mods/spawn_usher diff --git a/doc/files/mods/spawn_usher/init.html b/doc/files/mods/spawn_usher/init.html deleted file mode 100644 index 2143f12..0000000 --- a/doc/files/mods/spawn_usher/init.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Luadocs for mods/spawn_usher/init.lua - - - - - -
- -
- -
-
-
- -
- - - -
- -

File mods/spawn_usher/init.lua

- - - - - - - - - - - - -
-
- - - - - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/doc/files/mods/spawn_usher/spawnusher.html b/doc/files/mods/spawn_usher/spawnusher.html deleted file mode 100644 index fb4a625..0000000 --- a/doc/files/mods/spawn_usher/spawnusher.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - Luadocs for mods/spawn_usher/spawnusher.lua - - - - - -
- -
- -
-
-
- -
- - - -
- -

File mods/spawn_usher/spawnusher.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
spawnusher.activate (random_placement_radius, required_bubble_size, retry_time)Activates the spawn usher system.
spawnusher.is_air_bubble (start_pos)Tests if the given position is an air bubble big enough.
spawnusher.move_later (player, current_pos)Schedules the player to be moved later.
spawnusher.move_player (player)Moves the player to a safe location.
spawnusher.move_players ()Move all players that could not be placed so far.
spawnusher.move_random (player)Moves the player randomly on the x and z plane.
spawnusher.on_spawn_player (player)Callback for if a player spawns.
- - - - - - -
-
- - - - -

Functions

-
- - - -
spawnusher.activate (random_placement_radius, required_bubble_size, retry_time)
-
-Activates the spawn usher system. - - -

Parameters

-
    - -
  • - random_placement_radius: Optional. The player will be respawned in the given radius around the spawn point. -
  • - -
  • - required_bubble_size: Optional. The size/height of the bubble of air that is required for the player to spawn. Defaults to 2. -
  • - -
  • - retry_time: Optional. This is the time that passes between tries to place to the player. -
  • - -
- - - - - - - - -
- - - - -
spawnusher.is_air_bubble (start_pos)
-
-Tests if the given position is an air bubble big enough. - - -

Parameters

-
    - -
  • - start_pos: The position at which to check. -
  • - -
- - - - - - -

Return value:

-true if at the given position is an air bubble big enough. - - - -
- - - - -
spawnusher.move_later (player, current_pos)
-
-Schedules the player to be moved later. Also moves the player to the given position. - - -

Parameters

-
    - -
  • - player: The player object. -
  • - -
  • - current_pos: The current position to which the player will be moved. -
  • - -
- - - - - - - - -
- - - - -
spawnusher.move_player (player)
-
-Moves the player to a safe location. - - -

Parameters

-
    - -
  • - player: The player object. -
  • - -
- - - - - - - - -
- - - - -
spawnusher.move_players ()
-
-Move all players that could not be placed so far. - - - - - - - - - -
- - - - -
spawnusher.move_random (player)
-
-Moves the player randomly on the x and z plane. - - -

Parameters

-
    - -
  • - player: The Player object to move. -
  • - -
- - - - - - - - -
- - - - -
spawnusher.on_spawn_player (player)
-
-Callback for if a player spawns. - - -

Parameters

-
    - -
  • - player: The Player that spawned. -
  • - -
- - - - - - -

Return value:

-true, to disable default placement. - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/doc/index.html b/doc/index.html index 20f3df3..f477f7e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,94 +1,264 @@ - + - Luadocs Index - - + Reference + - +
- -
-
+ +
+
+
+ + + +
+

Module spawnusher

+

Spawn usher is a system that allows to correct the spawn position of players + without knowing anything about the mapgen.

+

+

The system will register callbacks for newplayer and respawnplayer and will + try to find an air bubble, either upwards or downwards, which the player can + fit into. If an air bubble is found, the player will be moved there. If + the block is not loaded, it will be tried again after a certain amount of + time. +

The only function that should be called from clients is activate.

- - - - -

Files

- - - - - - - - - - - - - +

Functions

+
mods/spawn_usher/init.lua
mods/spawn_usher/spawnusher.lua
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
activate (random_placement_radius, required_bubble_size, retry_time)Activates the spawn usher system.
is_air_bubble (start_pos)Tests if the given position is an air bubble big enough.
move_later (player, current_pos)Schedules the player to be moved later.
move_random (player)Moves the player randomly on the x and z plane.
move_player (player)Moves the player to a safe location.
move_players ()Move all players that could not be placed so far.
on_spawn_player (player)Callback for if a player spawns.
+
+
+ + +

Functions

+
+
+ + activate (random_placement_radius, required_bubble_size, retry_time) +
+
+ Activates the spawn usher system. + + +

Parameters:

+
    +
  • random_placement_radius + Optional. The player will be respawned in + the given radius around the spawn point. +
  • +
  • required_bubble_size + Optional. The size/height of the bubble of + air that is required for the player to spawn. + Defaults to 2. +
  • +
  • retry_time + Optional. This is the time that passes between tries to + place to the player. +
  • +
+ + + + + +
+
+ + is_air_bubble (start_pos) +
+
+ Tests if the given position is an air bubble big enough. + + +

Parameters:

+
    +
  • start_pos + The position at which to check. +
  • +
+ +

Returns:

+
    + + true if at the given position is an air bubble big enough. +
+ + + + +
+
+ + move_later (player, current_pos) +
+
+ Schedules the player to be moved later. Also moves the player to the given + position. + + + +

Parameters:

+
    +
  • player + The player object. +
  • +
  • current_pos + The current position to which the player will be moved. +
  • +
+ + + + + +
+
+ + move_random (player) +
+
+ Moves the player randomly on the x and z plane. + + +

Parameters:

+
    +
  • player + The Player object to move. +
  • +
+ + + + + +
+
+ + move_player (player) +
+
+ Moves the player to a safe location. + + +

Parameters:

+
    +
  • player + The player object. +
  • +
+ + + + + +
+
+ + move_players () +
+
+ Move all players that could not be placed so far. + + + + + + + +
+
+ + on_spawn_player (player) +
+
+ Callback for if a player spawns. + + +

Parameters:

+
    +
  • player + The Player that spawned. +
  • +
+ +

Returns:

+
    + + true, to disable default placement. +
+ + + + +
+
+
-
-
-

Valid XHTML 1.0!

+generated by LDoc 1.4.2
- diff --git a/doc/ldoc.css b/doc/ldoc.css new file mode 100644 index 0000000..765c710 --- /dev/null +++ b/doc/ldoc.css @@ -0,0 +1,302 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + list-style: disc; + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 0 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre.example { + background-color: rgb(245, 245, 245); + border: 1px solid silver; + padding: 10px; + margin: 10px 0 10px 0; + font-family: "Andale Mono", monospace; + font-size: .85em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid silver; + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 18em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 18em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #2239a8; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #a8660d; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } diff --git a/doc/luadoc.css b/doc/luadoc.css deleted file mode 100644 index bc0f98a..0000000 --- a/doc/luadoc.css +++ /dev/null @@ -1,286 +0,0 @@ -body { - margin-left: 1em; - margin-right: 1em; - font-family: arial, helvetica, geneva, sans-serif; - background-color:#ffffff; margin:0px; -} - -code { - font-family: "Andale Mono", monospace; -} - -tt { - font-family: "Andale Mono", monospace; -} - -body, td, th { font-size: 11pt; } - -h1, h2, h3, h4 { margin-left: 0em; } - -textarea, pre, tt { font-size:10pt; } -body, td, th { color:#000000; } -small { font-size:0.85em; } -h1 { font-size:1.5em; } -h2 { font-size:1.25em; } -h3 { font-size:1.15em; } -h4 { font-size:1.06em; } - -a:link { font-weight:bold; color: #004080; text-decoration: none; } -a:visited { font-weight:bold; color: #006699; text-decoration: none; } -a:link:hover { text-decoration:underline; } -hr { color:#cccccc } -img { border-width: 0px; } - - -h3 { padding-top: 1em; } - -p { margin-left: 1em; } - -p.name { - font-family: "Andale Mono", monospace; - padding-top: 1em; - margin-left: 0em; -} - -blockquote { margin-left: 3em; } - -pre.example { - background-color: rgb(245, 245, 245); - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: silver; - border-right-color: silver; - border-bottom-color: silver; - border-left-color: silver; - padding: 1em; - margin-left: 1em; - margin-right: 1em; - font-family: "Andale Mono", monospace; - font-size: smaller; -} - - -hr { - margin-left: 0em; - background: #00007f; - border: 0px; - height: 1px; -} - -ul { list-style-type: disc; } - -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } -table.index ul { padding-top: 0em; margin-top: 0em; } - -table { - border: 1px solid black; - border-collapse: collapse; - margin-left: auto; - margin-right: auto; -} -th { - border: 1px solid black; - padding: 0.5em; -} -td { - border: 1px solid black; - padding: 0.5em; -} -div.header, div.footer { margin-left: 0em; } - -#container -{ - margin-left: 1em; - margin-right: 1em; - background-color: #f0f0f0; -} - -#product -{ - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #ffffff; -} - -#product big { - font-size: 2em; -} - -#product_logo -{ -} - -#product_name -{ -} - -#product_description -{ -} - -#main -{ - background-color: #f0f0f0; - border-left: 2px solid #cccccc; -} - -#navigation -{ - float: left; - width: 18em; - margin: 0; - vertical-align: top; - background-color: #f0f0f0; - overflow:visible; -} - -#navigation h1 { - background-color:#e7e7e7; - font-size:1.1em; - color:#000000; - text-align:left; - margin:0px; - padding:0.2em; - border-top:1px solid #dddddd; - border-bottom:1px solid #dddddd; -} - -#navigation ul -{ - font-size:1em; - list-style-type: none; - padding: 0; - margin: 1px; -} - -#navigation li -{ - text-indent: -1em; - margin: 0em 0em 0em 0.5em; - display: block; - padding: 3px 0px 0px 12px; -} - -#navigation li li a -{ - padding: 0px 3px 0px -1em; -} - -#content -{ - margin-left: 18em; - padding: 1em; - border-left: 2px solid #cccccc; - border-right: 2px solid #cccccc; - background-color: #ffffff; -} - -#about -{ - clear: both; - margin: 0; - padding: 5px; - border-top: 2px solid #cccccc; - background-color: #ffffff; -} - -@media print { - body { - font: 12pt "Times New Roman", "TimeNR", Times, serif; - } - a { font-weight:bold; color: #004080; text-decoration: underline; } - - #main { background-color: #ffffff; border-left: 0px; } - #container { margin-left: 2%; margin-right: 2%; background-color: #ffffff; } - - #content { margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; } - - #navigation { display: none; - } - pre.example { - font-family: "Andale Mono", monospace; - font-size: 10pt; - page-break-inside: avoid; - } -} - -table.module_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.module_list td.name { background-color: #f0f0f0; } -table.module_list td.summary { width: 100%; } - -table.file_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.file_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.file_list td.name { background-color: #f0f0f0; } -table.file_list td.summary { width: 100%; } - - -table.function_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.function_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.function_list td.name { background-color: #f0f0f0; } -table.function_list td.summary { width: 100%; } - - -table.table_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.table_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.table_list td.name { background-color: #f0f0f0; } -table.table_list td.summary { width: 100%; } - -dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.function dd {padding-bottom: 1em;} -dl.function h3 {padding: 0; margin: 0; font-size: medium;} - -dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.table dd {padding-bottom: 1em;} -dl.table h3 {padding: 0; margin: 0; font-size: medium;} - -#TODO: make module_list, file_list, function_list, table_list inherit from a list -