From df7b3fb291e4df5ecbe30884e3c6464457df655a Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 2 Jun 2018 21:41:17 +0100 Subject: [PATCH] Updated Doc --- FactorioSoftmodManager.lua | 6 +- config.ld | 4 +- doc/index.html | 8 +- doc/modules/ExpGamingCore.Ranking.html | 882 ++++++++++++++++++ doc/modules/ExpGamingCore.Server.html | 4 +- doc/modules/ExpGamingCore.Sync.html | 22 +- doc/modules/ExpGamingLib.html | 4 +- doc/modules/FSM.html | 11 +- doc/modules/StdLib.Color.html | 4 +- doc/modules/StdLib.Game.html | 4 +- doc/modules/StdLib.String.html | 4 +- doc/modules/StdLib.Table.html | 4 +- doc/modules/StdLib.Time.html | 4 +- ...odules.expgamingcore.commands.control.html | 4 +- .../modules.expgamingcore.gui.control.html | 4 +- ...les.expgamingcore.gui.guiparts.center.html | 4 +- ...les.expgamingcore.gui.guiparts.inputs.html | 4 +- ...dules.expgamingcore.gui.guiparts.left.html | 4 +- ...ules.expgamingcore.gui.guiparts.popup.html | 4 +- ...es.expgamingcore.gui.guiparts.toolbar.html | 4 +- ...modules.expgamingcore.ranking.control.html | 381 -------- modules/ExpGamingCore/Ranking/control.lua | 11 +- modules/ExpGamingCore/Ranking/src/config.lua | 6 - modules/ExpGamingCore/Ranking/src/core.lua | 6 - modules/ExpGamingCore/Ranking/src/server.lua | 2 +- modules/ExpGamingCore/Sync/src/gui.lua | 5 +- modules/ExpGamingCore/Sync/src/ranking.lua | 2 +- 27 files changed, 953 insertions(+), 449 deletions(-) create mode 100644 doc/modules/ExpGamingCore.Ranking.html delete mode 100644 doc/modules/modules.expgamingcore.ranking.control.html diff --git a/FactorioSoftmodManager.lua b/FactorioSoftmodManager.lua index 863f2a5c..e1916ba0 100644 --- a/FactorioSoftmodManager.lua +++ b/FactorioSoftmodManager.lua @@ -155,7 +155,7 @@ Manager.verbose('Current state is now: "selfInit"; The verbose state is: '..tost -- @treturn table the new global table for that module Manager.global=setmetatable({__defaults={},__global={ __call=function(tbl,default) return Manager.global(default) end, - __index=function(tbl,key) return Manager.global() == tbl and nil or rawget(Manager.global(),key) end, + __index=function(tbl,key) return Manager.global() == tbl and nil or rawget(Manager.global(),key) or tbl(key) end, __newindex=function(tbl,key,value) rawset(Manager.global(),key,value) end, __pairs=function(tbl) local tbl = Manager.global() @@ -185,12 +185,10 @@ Manager.global=setmetatable({__defaults={},__global={ end return global end, - __index=function(tbl,key) Manager.verbose('Manager Index') return rawget(tbl(),key) or rawget(_G.global,key) end, + __index=function(tbl,key) return rawget(tbl(),key) or rawget(_G.global,key) or tbl(key) end, __newindex=function(tbl,key,value) rawset(tbl(),key,value) end, __pairs=function(tbl) - Manager.verbose('Manager Pair 1') local tbl = Manager.global() - Manager.verbose('Manager Pair 2') local function next_pair(tbl,k) k, v = next(tbl, k) if type(v) ~= nil then return k,v end diff --git a/config.ld b/config.ld index e8a714be..c79db209 100644 --- a/config.ld +++ b/config.ld @@ -1,3 +1,3 @@ new_type('command','Commands',false,'param') -new_type('event','Commands',false,'field') -new_type('gui','Commands') \ No newline at end of file +new_type('event','Events',false,'field') +new_type('gui','Guis') \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 9feb5b9d..27be2284 100644 --- a/doc/index.html +++ b/doc/index.html @@ -39,7 +39,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -91,8 +91,8 @@ Add a white bar to any gui frame - modules.expgamingcore.ranking.control - Returns a rank object given a player or rank name + ExpGamingCore.Ranking + A full ranking system for factorio. ExpGamingCore.Server @@ -132,7 +132,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/ExpGamingCore.Ranking.html b/doc/modules/ExpGamingCore.Ranking.html new file mode 100644 index 00000000..b221ebdc --- /dev/null +++ b/doc/modules/ExpGamingCore.Ranking.html @@ -0,0 +1,882 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module ExpGamingCore.Ranking

    +

    A full ranking system for factorio.

    +

    +

    Info:

    +
      +
    • License: https://github.com/explosivegaming/scenario/blob/master/LICENSE
    • +
    • Author: Cooldude2606
    • +
    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    output_ranks ([player=server])Outputs as a string all the ranks and the loaded order
    _base_preset (ranks)Used to set the prset ranks that will be given to players
    get_rank (mixed)Returns a rank object given a player or rank name
    get_group (mixed)Returns the group object used to sort ranks given group name or rank
    print (rank_base, rtn[, colour=defines.color.white[, below=false]])Prints to all rank of greater/lower power of the rank given
    give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]])Gives a user a rank
    revert (player[, by_player=nil])Revert the last change to a players rank
    find_preset (player[, tick=nil])Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met
    +

    Tables

    + + + + + + + + + + + + + + + + + +
    globalGlobal Table
    ranksContains the location of all the ranks, readonly during runtime
    ranksContains the location of all the rank groups, readonly during runtime
    metaContains some meta data about the ranks
    +

    Events

    + + + + + +
    rank_changeCalled when there is a rank change for a user
    +

    Class Rank

    + + + + + + + + + + + + + + + + + +
    Ranking._rank:allowed (action)Is this rank allowed to open this gui or use this command etc.
    Ranking._rank:get_players ([online=false])Get all the players in this rank
    Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])Print a message to all players of this rank
    Ranking._rank:edit (key, value)Allows for a clean way to edit rank objects
    +

    Class Group

    + + + + + + + + + + + + + +
    Ranking._group:create (obj)Creates a new group
    Ranking._group:add_rank (obj)Creats a new rank with this group as its group
    Ranking._group:edit (key, value)Allows for a clean way to edit rank group objects
    +

    modules.expgamingcore.ranking.src.server Functions

    + + + + + + + + + +
    _comment ()This file will be loaded when ExpGamingCore.Server is present
    Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]])Print a message to all players of this rank
    + +
    +
    + + +

    Functions

    + +
    +
    + + output_ranks ([player=server]) +
    +
    + Outputs as a string all the ranks and the loaded order + + +

    Parameters:

    +
      +
    • player + player_name, player_index or LuaPlayer + the player that the info will be printed to, nil will print to server + (default server) +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking.output_ranks(player) -- prints to player
      +
    + +
    +
    + + _base_preset (ranks) +
    +
    + Used to set the prset ranks that will be given to players + + +

    Parameters:

    +
      +
    • ranks + table + table of player names with the player name as the key and rank name as the value +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking._base_preset{name=rank_name,nameTwo=rank_name_two} -- sets player name to have rank rank_name on join
      +
    + +
    +
    + + get_rank (mixed) +
    +
    + Returns a rank object given a player or rank name + + +

    Parameters:

    +
      +
    • mixed + player, player_index, player_name, rank_name, Ranking._rank, 'server' or 'root' + what rank to get +
    • +
    + +

    Returns:

    +
      + + table + the rank that is linked to mixed +
    +

    Or

    +
      + + nil + there was no rank found +
    + + + +

    Usage:

    +
      +
    • Ranking.get_rank(game.player) -- returns player's rank
    • +
    • Ranking.get_rank('admin') -- returns rank by the name of admin
    • +
    + +
    +
    + + get_group (mixed) +
    +
    + Returns the group object used to sort ranks given group name or rank + + +

    Parameters:

    +
      +
    • mixed + player, player_index, player_name, rank_name, rank, 'server', 'root', group_name or group + what group to get +
    • +
    + +

    Returns:

    +
      + + table + the group that is linked to mixed +
    +

    Or

    +
      + + nil + there was no rank group found +
    + + +

    See also:

    + + +

    Usage:

    +
      +
    • Ranking.get_group(game.player) -- returns player's rank group
    • +
    • Ranking.get_group('root') -- returns group by name of root
    • +
    + +
    +
    + + print (rank_base, rtn[, colour=defines.color.white[, below=false]]) +
    +
    + Prints to all rank of greater/lower power of the rank given + + +

    Parameters:

    +
      +
    • rank_base + Ranking._rank or pointerToRank + the rank that acts as the cut off point (rank is always included) +
    • +
    • rtn + what do you want to return to the players +
    • +
    • colour + defines.color + the colour that will be used to print + (default defines.color.white) +
    • +
    • below + boolean + if true print to children rather than parents + (default false) +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking.print('admin','We got a grifer')
      +
    + +
    +
    + + give_rank (player[, rank=default[, by_player='server'[, tick=game.tick]]]) +
    +
    + Gives a user a rank + + +

    Parameters:

    +
      +
    • player + LuaPlayer or pointerToPlayer + the player to give the rank to +
    • +
    • rank + Ranking._rank or pointerToRank + the rank to give to the player + (default default) +
    • +
    • by_player + LuaPlayer or pointerToPlayer + the player who is giving the rank + (default 'server') +
    • +
    • tick + number + the tick that the rank is being given on, used as pass though + (default game.tick) +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking.give_rank(1,'admin')
      +
    + +
    +
    + + revert (player[, by_player=nil]) +
    +
    + Revert the last change to a players rank + + +

    Parameters:

    +
      +
    • player + LuaPlayer or pointerToPlayer + the player to revert the rank of +
    • +
    • by_player + the player who is doing the revert + (default nil) +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking.revert(1) -- reverts the rank of player with index 1
      +
    + +
    +
    + + find_preset (player[, tick=nil]) +
    +
    + Given that the player has a rank in the preset table it is given; also will attempt to promote players if a time requirement is met + + +

    Parameters:

    +
      +
    • player + LuaPlayer or pointerToPlayer + the player to test for an auto rank +
    • +
    • tick + number + the tick it happens on + (default nil) +
    • +
    + + + + +

    Usage:

    +
      +
      Ranking.find_preset(1) -- attemps to find the preset for player with index 1
      +
    + +
    +
    +

    Tables

    + +
    +
    + + global +
    +
    + Global Table + + +

    Fields:

    +
      +
    • old + contains the previous rank a use had before a rank change +
    • +
    • preset + contains the preset ranks that users will recive apon joining +
    • +
    • last_change + contains the name of the player who last had there rank chagned +
    • +
    + + + + + +
    +
    + + ranks +
    +
    + Contains the location of all the ranks, readonly during runtime + + + + + + + +
    +
    + + ranks +
    +
    + Contains the location of all the rank groups, readonly during runtime + + + + + + + +
    +
    + + meta +
    +
    + Contains some meta data about the ranks + + +

    Fields:

    +
      +
    • default + this is the name of the default rank +
    • +
    • root + this is the name of the root rank +
    • +
    • time_ranks + a list of all ranks which have a time requirement +
    • +
    • time_highest + the power of the highest rank that has a time requirement +
    • +
    • time_lowest + the lowest amount of time required for a time rank +
    • +
    + + + + + +
    +
    +

    Events

    + +
    +
    + + rank_change +
    +
    + Called when there is a rank change for a user + + +

    field:

    +
      +
    • name + the rank id +
    • +
    • tick + the tick which the event was raised on +
    • +
    • player_index + the player whos rank was changed +
    • +
    • by_player_index + the player who changed the rank, 0 means server +
    • +
    • new_rank + the name of the rank that was given +
    • +
    • old_rank + the name of the rank the player had +
    • +
    + + + + + +
    +
    +

    Class Rank

    + +
    + The class for the ranks +
    +
    +
    + + Ranking._rank:allowed (action) +
    +
    + Is this rank allowed to open this gui or use this command etc. + + +

    Parameters:

    +
      +
    • action + teh + to test for +
    • +
    + +

    Returns:

    +
      + + boolean + is it allowed +
    + + + +

    Usage:

    +
      +
      rank:allowed('interface') -- does the rank have permision for 'interface'
      +
    + +
    +
    + + Ranking._rank:get_players ([online=false]) +
    +
    + Get all the players in this rank + + +

    Parameters:

    +
      +
    • online + boolean + get only online players + (default false) +
    • +
    + +

    Returns:

    +
      + + table + a table of all players in this rank +
    + + + +

    Usage:

    +
      +
      rank:get_players()
      +
    + +
    +
    + + Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]]) +
    +
    + Print a message to all players of this rank + + +

    Parameters:

    +
      +
    • rtn + any value you want to return +
    • +
    • colour + define.color + the colour that will be used to print + (default defines.color.white) +
    • +
    • show_default + boolean + weather to use the default rank name for the print, used as a pass though + (default false) +
    • +
    + + + + +

    Usage:

    +
      +
      rank:print('foo') -- prints to all members of this rank
      +
    + +
    +
    + + Ranking._rank:edit (key, value) +
    +
    + Allows for a clean way to edit rank objects + + +

    Parameters:

    +
      +
    • key + string + the key to edit, often allow or disallow +
    • +
    • value + the new value to be set +
    • +
    + + + + +

    Usage:

    +
      +
      rank:edit('allow',{'interface'}) -- allows this rank to use 'interface'
      +
    + +
    +
    +

    Class Group

    + +
    + The class for the rank groups, the way to allow modules to idex a group that is always present, ranks will always look to there group as a parent +
    +
    +
    + + Ranking._group:create (obj) +
    +
    + Creates a new group + + +

    Parameters:

    +
      +
    • obj + table + the fields for this object +
    • +
    + +

    Returns:

    +
      + + Ranking._group + returns the object to allow chaining +
    + + + +

    Usage:

    +
      +
      Ranking._group:create{name='root'} -- returns group with name root
      +
    + +
    +
    + + Ranking._group:add_rank (obj) +
    +
    + Creats a new rank with this group as its group + + +

    Parameters:

    +
      +
    • obj + table + the fields for this object +
    • +
    + +

    Returns:

    +
      + + Ranking._group + returns the object to allow chaining +
    + + + +

    Usage:

    +
      +
      group:add_rank{name='root'} -- returns self
      +
    + +
    +
    + + Ranking._group:edit (key, value) +
    +
    + Allows for a clean way to edit rank group objects + + +

    Parameters:

    +
      +
    • key + string + the key to edit, often allow or disallow +
    • +
    • value + the new value to be set +
    • +
    + + + + +

    Usage:

    +
      +
      group:edit('allow',{'interface'}) -- allows this rank to use 'interface'
      +
    + +
    +
    +

    modules.expgamingcore.ranking.src.server Functions

    + +
    +
    + + _comment () +
    +
    + This file will be loaded when ExpGamingCore.Server is present + + + + + + + +
    +
    + + Ranking._rank:print (rtn[, colour=defines.color.white[, show_default=false]]) +
    +
    + Print a message to all players of this rank + + +

    Parameters:

    +
      +
    • rtn + any value you want to return +
    • +
    • colour + define.color + the colour that will be used to print + (default defines.color.white) +
    • +
    • show_default + boolean + weather to use the default rank name for the print, used as a pass though + (default false) +
    • +
    + + + + +

    Usage:

    +
      +
      rank:print('foo') -- prints to all members of this rank
      +
    + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated 2018-06-02 21:40:51 +
    +
    + + diff --git a/doc/modules/ExpGamingCore.Server.html b/doc/modules/ExpGamingCore.Server.html index e6a302f3..af7f3d4e 100644 --- a/doc/modules/ExpGamingCore.Server.html +++ b/doc/modules/ExpGamingCore.Server.html @@ -50,7 +50,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -828,7 +828,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/ExpGamingCore.Sync.html b/doc/modules/ExpGamingCore.Sync.html index 20c91a7f..45206ac7 100644 --- a/doc/modules/ExpGamingCore.Sync.html +++ b/doc/modules/ExpGamingCore.Sync.html @@ -50,7 +50,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -158,6 +158,10 @@ add_to_gui (element) Adds a emeltent to the sever info gui + + server-info + Creates a center gui that will appear on join +

    modules.expgamingcore.sync.src.ranking Functions

    @@ -720,6 +724,20 @@
    Sync.add_to_gui('string') -- return true
    + +
    + + server-info +
    +
    + Creates a center gui that will appear on join + + + + + + +

    modules.expgamingcore.sync.src.ranking Functions

    @@ -794,7 +812,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/ExpGamingLib.html b/doc/modules/ExpGamingLib.html index 7b623237..b044c6e7 100644 --- a/doc/modules/ExpGamingLib.html +++ b/doc/modules/ExpGamingLib.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -412,7 +412,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/FSM.html b/doc/modules/FSM.html index acd010c5..a4595c28 100644 --- a/doc/modules/FSM.html +++ b/doc/modules/FSM.html @@ -48,7 +48,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -421,9 +421,9 @@ @@ -436,6 +436,7 @@
  • global[key] -- used like the normal global table
  • global{'foo','bar'} -- sets the default value
  • global(true) -- restores global to default
  • +
  • global(mopdule_name) -- returns that module's global
  • @@ -446,7 +447,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/StdLib.Color.html b/doc/modules/StdLib.Color.html index e2efad66..935a6c09 100644 --- a/doc/modules/StdLib.Color.html +++ b/doc/modules/StdLib.Color.html @@ -47,7 +47,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -553,7 +553,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/StdLib.Game.html b/doc/modules/StdLib.Game.html index a3d7da7a..441381ef 100644 --- a/doc/modules/StdLib.Game.html +++ b/doc/modules/StdLib.Game.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -214,7 +214,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/StdLib.String.html b/doc/modules/StdLib.String.html index b2924c8a..b3e89aab 100644 --- a/doc/modules/StdLib.String.html +++ b/doc/modules/StdLib.String.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -294,7 +294,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/StdLib.Table.html b/doc/modules/StdLib.Table.html index 5a85e0e7..3864f2ce 100644 --- a/doc/modules/StdLib.Table.html +++ b/doc/modules/StdLib.Table.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -1123,7 +1123,7 @@ some_func(1,2)
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/StdLib.Time.html b/doc/modules/StdLib.Time.html index 9b5dd816..26c9fd4b 100644 --- a/doc/modules/StdLib.Time.html +++ b/doc/modules/StdLib.Time.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -131,7 +131,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.commands.control.html b/doc/modules/modules.expgamingcore.commands.control.html index bd16c3b0..ea606cc1 100644 --- a/doc/modules/modules.expgamingcore.commands.control.html +++ b/doc/modules/modules.expgamingcore.commands.control.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -124,7 +124,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.control.html b/doc/modules/modules.expgamingcore.gui.control.html index ab3125b7..8614ed29 100644 --- a/doc/modules/modules.expgamingcore.gui.control.html +++ b/doc/modules/modules.expgamingcore.gui.control.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -160,7 +160,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.guiparts.center.html b/doc/modules/modules.expgamingcore.gui.guiparts.center.html index 124667d9..65c35f8b 100644 --- a/doc/modules/modules.expgamingcore.gui.guiparts.center.html +++ b/doc/modules/modules.expgamingcore.gui.guiparts.center.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -278,7 +278,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.guiparts.inputs.html b/doc/modules/modules.expgamingcore.gui.guiparts.inputs.html index 7e375716..70e4eb4b 100644 --- a/doc/modules/modules.expgamingcore.gui.guiparts.inputs.html +++ b/doc/modules/modules.expgamingcore.gui.guiparts.inputs.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -434,7 +434,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.guiparts.left.html b/doc/modules/modules.expgamingcore.gui.guiparts.left.html index c08d35f9..0196fe8f 100644 --- a/doc/modules/modules.expgamingcore.gui.guiparts.left.html +++ b/doc/modules/modules.expgamingcore.gui.guiparts.left.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -181,7 +181,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.guiparts.popup.html b/doc/modules/modules.expgamingcore.gui.guiparts.popup.html index e73fe754..5de07ceb 100644 --- a/doc/modules/modules.expgamingcore.gui.guiparts.popup.html +++ b/doc/modules/modules.expgamingcore.gui.guiparts.popup.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -126,7 +126,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.gui.guiparts.toolbar.html b/doc/modules/modules.expgamingcore.gui.guiparts.toolbar.html index e27ca143..8898c1b5 100644 --- a/doc/modules/modules.expgamingcore.gui.guiparts.toolbar.html +++ b/doc/modules/modules.expgamingcore.gui.guiparts.toolbar.html @@ -46,7 +46,7 @@
  • modules.expgamingcore.gui.guiparts.popup
  • modules.expgamingcore.gui.guiparts.toolbar
  • modules.expgamingcore.gui.control
  • -
  • modules.expgamingcore.ranking.control
  • +
  • ExpGamingCore.Ranking
  • ExpGamingCore.Server
  • ExpGamingCore.Sync
  • ExpGamingLib
  • @@ -117,7 +117,7 @@
    generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 +Last updated 2018-06-02 21:40:51
    diff --git a/doc/modules/modules.expgamingcore.ranking.control.html b/doc/modules/modules.expgamingcore.ranking.control.html deleted file mode 100644 index 8e203aae..00000000 --- a/doc/modules/modules.expgamingcore.ranking.control.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - Reference - - - - -
    - -
    - -
    -
    -
    - - -
    - - - - - - -
    - -

    Module modules.expgamingcore.ranking.control

    -

    Returns a rank object given a player or rank name

    -

    -

    Usage:

    -
      -
      Ranking.get_rank(game.player)
      - Ranking.get_rank('admin')
      -
      -
    - - -

    Functions

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Ranking.get_group (mixed)Returns the group object used to sort ranks given group name or see Ranking.get_rank
    Ranking.print (rank_base, rtn, colour, below)Prints to all rank of greater/lower power of the rank given
    Ranking.give_rank (player, rank[, by_player='server'[, tick=game.tick]])Gives a user a rank
    Ranking.revert (player[, by_player=nil])Revert the last change to a players rank
    Ranking.find_preset (player[, tick=nil])Given the player has a rank in the preset table it is given
    Ranking._rank:allowed (action)Is this rank allowed to open this gui or use this command etc.
    Ranking._rank:get_players (online)Get all the players in this rank
    Ranking._rank:print (rtn, colour, show_default)Print a message to all players of this rank
    - -
    -
    - - -

    Functions

    - -
    -
    - - Ranking.get_group (mixed) -
    -
    - Returns the group object used to sort ranks given group name or see Ranking.get_rank - - -

    Parameters:

    -
      -
    • mixed - player|player index|player name|rank name|rank|'server'|'root'|group name|group what group to get -
    • -
    - -

    Returns:

    -
      - - table - the group that is linked to mixed -
    - - - -

    Usage:

    -
      -
      Ranking.get_group(game.player)
      - Ranking.get_group('root')
      -
    - -
    -
    - - Ranking.print (rank_base, rtn, colour, below) -
    -
    - Prints to all rank of greater/lower power of the rank given - - -

    Parameters:

    -
      -
    • rank_base - the rank that acts as the cut off point (rank is always included) -
    • -
    • rtn - what do you want to return to the players -
    • -
    • colour - defines.color - the colour that will be used to print -
    • -
    • below - bolean - if true rank below base are printed to -
    • -
    - - - - -

    Usage:

    -
      -
      Ranking.print('admin','We got a grifer')
      -
    - -
    -
    - - Ranking.give_rank (player, rank[, by_player='server'[, tick=game.tick]]) -
    -
    - Gives a user a rank - - -

    Parameters:

    -
      -
    • player - the player to give the rank to -
    • -
    • rank - the rank to give to the player -
    • -
    • by_player - the player who is giving the rank - (default 'server') -
    • -
    • tick - the tick that the rank is being given on - (default game.tick) -
    • -
    - - - - -

    Usage:

    -
      -
      Ranking.give_rank(1,'admin')
      -
    - -
    -
    - - Ranking.revert (player[, by_player=nil]) -
    -
    - Revert the last change to a players rank - - -

    Parameters:

    -
      -
    • player - the player to revert the rank of -
    • -
    • by_player - the player who is doing the revert - (default nil) -
    • -
    - - - - -

    Usage:

    -
      -
      Ranking.revert(1)
      -
    - -
    -
    - - Ranking.find_preset (player[, tick=nil]) -
    -
    - Given the player has a rank in the preset table it is given - - -

    Parameters:

    -
      -
    • player - the player to test for an auto rank -
    • -
    • tick - number - the tick it happens on - (default nil) -
    • -
    - - - - -

    Usage:

    -
      -
      Ranking.find_preset(1)
      -
    - -
    -
    - - Ranking._rank:allowed (action) -
    -
    - Is this rank allowed to open this gui or use this command etc. - - -

    Parameters:

    -
      -
    • action - teh - to test for -
    • -
    - -

    Returns:

    -
      - - bolean - is it allowed -
    - - - -

    Usage:

    -
      -
      rank:allowed('server-interface')
      -
    - -
    -
    - - Ranking._rank:get_players (online) -
    -
    - Get all the players in this rank - - -

    Parameters:

    -
      -
    • online - bolean - get only online players -
    • -
    - -

    Returns:

    -
      - - table - a table of all players in this rank -
    - - - -

    Usage:

    -
      -
      rank:get_players()
      -
    - -
    -
    - - Ranking._rank:print (rtn, colour, show_default) -
    -
    - Print a message to all players of this rank - - -

    Parameters:

    -
      -
    • rtn - any value you want to return -
    • -
    • colour - define.color - the colour that will be used to print -
    • -
    • show_default - boolean - weather to use the default rank name for the print -
    • -
    - - - - -

    Usage:

    -
      -
      rank:print('foo')
      -
    - -
    -
    - - - - -
    -generated by LDoc 1.4.6 -Last updated 2018-06-01 16:29:39 -
    - - - diff --git a/modules/ExpGamingCore/Ranking/control.lua b/modules/ExpGamingCore/Ranking/control.lua index 7a56de38..644684c9 100644 --- a/modules/ExpGamingCore/Ranking/control.lua +++ b/modules/ExpGamingCore/Ranking/control.lua @@ -3,7 +3,6 @@ -- @alias Ranking -- @author Cooldude2606 -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE - local Ranking = {} local module_verbose = false --true|false @@ -11,7 +10,7 @@ local module_verbose = false --true|false -- @table global -- @field old contains the previous rank a use had before a rank change -- @field preset contains the preset ranks that users will recive apon joining --- @filed last_change contains the name of the player who last had there rank chagned +-- @field last_change contains the name of the player who last had there rank chagned local global = global{old={},preset={},last_change=nil} --- Called when there is a rank change for a user @@ -78,7 +77,7 @@ Ranking.groups = setmetatable({},{ --- Contains some meta data about the ranks -- @table Ranking.meta -- @field default this is the name of the default rank --- @filed root this is the name of the root rank +-- @field root this is the name of the root rank -- @field time_ranks a list of all ranks which have a time requirement -- @field time_highest the power of the highest rank that has a time requirement -- @field time_lowest the lowest amount of time required for a time rank @@ -118,7 +117,7 @@ end -- @usage Ranking.get_rank('admin') -- returns rank by the name of admin -- @tparam ?player|player_index|player_name|rank_name|Ranking._rank|'server'|'root' mixed what rank to get -- @treturn[1] table the rank that is linked to mixed --- @trrturn[2] nil there was no rank found +-- @treturn[2] nil there was no rank found function Ranking.get_rank(mixed) if not mixed then return error('Ranking.get_rank recived no paramerters') end local ranks = Ranking.ranks @@ -141,10 +140,10 @@ end --- Returns the group object used to sort ranks given group name or rank -- @usage Ranking.get_group(game.player) -- returns player's rank group -- @usage Ranking.get_group('root') -- returns group by name of root --- @tparam ?player|player_index|player_name|rank_name|rank|'server'|'root'|group name|group mixed what group to get +-- @tparam ?player|player_index|player_name|rank_name|rank|'server'|'root'|group_name|group mixed what group to get -- @see Ranking.get_rank -- @treturn[1] table the group that is linked to mixed --- @trrturn[2] nil there was no rank group found +-- @treturn[2] nil there was no rank group found function Ranking.get_group(mixed) if not mixed then return error('Ranking.get_group recived no paramerters') end local groups = Ranking.groups diff --git a/modules/ExpGamingCore/Ranking/src/config.lua b/modules/ExpGamingCore/Ranking/src/config.lua index 2a50707d..fde68174 100644 --- a/modules/ExpGamingCore/Ranking/src/config.lua +++ b/modules/ExpGamingCore/Ranking/src/config.lua @@ -1,9 +1,3 @@ ---- Description - A small description that will be displayed on the doc --- @submodule ExpGamingCore.Ranking --- @alias Ranking --- @author Cooldude2606 --- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE - --[[ How to use groups: name The name that you can use to reference it. diff --git a/modules/ExpGamingCore/Ranking/src/core.lua b/modules/ExpGamingCore/Ranking/src/core.lua index d8ad5c81..b8707489 100644 --- a/modules/ExpGamingCore/Ranking/src/core.lua +++ b/modules/ExpGamingCore/Ranking/src/core.lua @@ -1,9 +1,3 @@ ---- Description - A small description that will be displayed on the doc --- @submodule ExpGamingCore.Ranking --- @alias Ranking --- @author Cooldude2606 --- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE - --[[ How to use groups: name the name that you can use to refence it. diff --git a/modules/ExpGamingCore/Ranking/src/server.lua b/modules/ExpGamingCore/Ranking/src/server.lua index 22b66ef7..bef291b1 100644 --- a/modules/ExpGamingCore/Ranking/src/server.lua +++ b/modules/ExpGamingCore/Ranking/src/server.lua @@ -1,4 +1,4 @@ ---- Description - A small description that will be displayed on the doc +--- A full ranking system for factorio. -- @submodule ExpGamingCore.Ranking -- @alias Ranking -- @author Cooldude2606 diff --git a/modules/ExpGamingCore/Sync/src/gui.lua b/modules/ExpGamingCore/Sync/src/gui.lua index dc3b4b23..914cb883 100644 --- a/modules/ExpGamingCore/Sync/src/gui.lua +++ b/modules/ExpGamingCore/Sync/src/gui.lua @@ -1,4 +1,4 @@ ---- Description - A small description that will be displayed on the doc +--- Allows syncing with an outside server and info panle. -- @submodule ExpGamingCore.Sync -- @alias Sync -- @author Cooldude2606 @@ -36,8 +36,7 @@ local function label_format(label,width) end --- Creates a center gui that will appear on join --- @table server-info --- @local call to Gui.Center +-- @gui server-info Gui.center.add{ name='server-info', caption='Server Info', diff --git a/modules/ExpGamingCore/Sync/src/ranking.lua b/modules/ExpGamingCore/Sync/src/ranking.lua index a15944db..c0bb7bef 100644 --- a/modules/ExpGamingCore/Sync/src/ranking.lua +++ b/modules/ExpGamingCore/Sync/src/ranking.lua @@ -1,4 +1,4 @@ ---- Description - A small description that will be displayed on the doc +--- Allows syncing with an outside server and info panle. -- @submodule ExpGamingCore.Sync -- @alias Sync -- @author Cooldude2606