Xonotic
sv_minigames.qh
Go to the documentation of this file.
1 #pragma once
2 
5 
8 entity start_minigame(entity player, string minigame );
9 
12 entity join_minigame(entity player, string game_id );
13 
16 string invite_minigame(entity inviter, entity player);
17 
18 // Part minigame session
19 void part_minigame(entity player);
20 
21 // Ends a minigame session
22 void end_minigame(entity minigame_session);
23 
24 // Ends all minigame sessions
25 void end_minigames();
26 
27 // Only sends entities to players who joined the minigame
28 // Use on customizeentityforclient for gameplay entities
29 bool minigame_CheckSend(entity this, entity client);
30 
31 // Check for minigame impulses
32 bool MinigameImpulse(entity this, int imp);
33 
34 // Parse a client command ( cmd minigame ... )
35 void ClientCommand_minigame(entity caller, int request, int argc, string command);
36 
37 // Find the minigame_player entity for the given client entity
39 
42 
46 
48 
49 bool minigame_SendEntity(entity this, entity to, int sf);
50 
51 REGISTRY(Minigames, BITS(4))
52 REGISTER_REGISTRY(Minigames)
53 REGISTRY_CHECK(Minigames)
54 
55 REGISTRY_DEFINE_GET(Minigames, NULL)
56 #define REGISTER_MINIGAME(name,nicename) \
57  REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \
58  int name##_server_event(entity, string, ...); \
59  REGISTER_INIT(MINIGAME_##name) { \
60  this.netname = strzone(strtolower(#name)); \
61  this.message = nicename; \
62  this.minigame_event = name##_server_event; \
63  } \
64  REGISTER_INIT(MINIGAME_##name)
int int int imp
Definition: impulse.qc:90
entity start_minigame(entity player, string minigame)
Create a new minigame session.
void part_minigame(entity player)
entity() spawn
#define REGISTRY_CHECK(id)
Definition: registry.qh:175
bool minigame_SendEntity(entity this, entity to, int sf)
Definition: sv_minigames.qc:64
entity to
Definition: self.qh:96
bool autocvar_sv_minigames_observer
Definition: sv_minigames.qh:4
#define REGISTER_REGISTRY(id)
Definition: registry.qh:212
bool MinigameImpulse(entity this, int imp)
#define REGISTRY_DEFINE_GET(id, null)
Definition: registry.qh:40
entity minigame_players
For minigame sessions: list of players For minigame_player: client entity.
Definition: sv_minigames.qh:45
void ClientCommand_minigame(entity caller, int request, int argc, string command)
#define REGISTRY(id, max)
Declare a new registry.
Definition: registry.qh:26
#define NULL
Definition: post.qh:17
bool autocvar_sv_minigames
Definition: sv_minigames.qh:3
void end_minigames()
string invite_minigame(entity inviter, entity player)
Invite a player to join in a minigame.
void end_minigame(entity minigame_session)
entity active_minigame
For players: Minigame being played.
Definition: sv_minigames.qh:41
entity minigame_sessions
Definition: sv_minigames.qh:47
bool minigame_CheckSend(entity this, entity client)
#define BITS(n)
Definition: bits.qh:9
entity minigame_find_player(entity client)
entity join_minigame(entity player, string game_id)
Join an existing minigame session.