Resource:Mapmanager

From Multi Theft Auto: Wiki
Revision as of 14:47, 18 April 2007 by Jbeta (talk | contribs) (Need opinions on this)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes an implementation for the map manager, the resource which will take care of map listing and gamemode/map interactions.

Usage

The manager will assume all map and gamemode resources are correctly tagged as such in the meta file.

<info description="A gamemode" type="gamemode" />

Map resources can optionally specify the gamemodes for which they have been designed in a comma-separated list:

<info description="A gamemode map" type="map" gamemodes="ctv,koth" />

There can be only one gamemode and one gamemode map loaded at once. When a map resource is started via start, the manager will check if any of the gamemodes it is compatible with is loaded, and change the current gamemode map in that case. Else, it will just be loaded as a normal map.

The map manager will also provide special commands to start a map running a specific gamemode (for example startmap map_mall -g copsnrobbers) or the other way around (gamemode copsnrobbers -m map_mall).

There should be a web interface, with a tree of maps registered under each gamemode and start/stop controls.

Exported functions

bool changeGamemode ( resource gamemode )
bool changeGamemodeMap ( resource map, [ resource gamemode ] )
bool stopGamemode ( )
bool stopGamemodeMap ( )
resource getRunningGamemode ( )
resource getRunningGamemodeMap ( )
table getMapsCompatibleWithGamemode ( resource gamemode )

Fired events

onGamemodeStart ( resource gamemode )
onGamemodeStop ( resource gamemode )
onGamemodeMapStart ( resource map )
onGamemodeMapStop ( resource map )