Event definition functions

Added functions that allow new event types to be defined. The functions
are:
 * events.evdef_start() which starts recording a definition,
 * events.evdef_addfld_*(), a set of functions to add fields to
the current definition,
 * events.evdef_finalise() which adds the definition records and creates
the event queue table.

It is not possible to modify or delete event definitions at this time.
They will be added if and when they become necessary.
This commit is contained in:
Emmanuel BENOîT 2012-06-29 15:18:18 +02:00
parent ff78c6a2d6
commit 0c67d1e799
2 changed files with 841 additions and 1 deletions
legacyworlds-server-data/db-structure/parts/030-data

View file

@ -63,6 +63,8 @@ CREATE TYPE events.entity_field_type AS ENUM(
'PLN' ,
/* A fleet */
'FLT' ,
/* An alliance */
'ALL' ,
/* A battle */
'BAT' ,
/* An administrator */
@ -159,6 +161,18 @@ ALTER TABLE events.field_definitions
GRANT SELECT ON events.field_definitions TO :dbuser;
/*
* Event identifier sequence
* -------------------------
*
* This sequence is used by the various type-specific event queues to
* generate the events' identifiers.
*/
DROP SEQUENCE IF EXISTS events.event_id_sequence CASCADE;
CREATE SEQUENCE events.event_id_sequence;
GRANT SELECT,UPDATE ON events.event_id_sequence TO :dbuser;
/*
* OLD B6M1 CODE BELOW!