Nuclide
Software Development Kit for id Technology (BETA)
AddonDelegate.h
1/*
2 * Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
102{
103public:
104 void ncAddonDelegate(void);
105
107 virtual void Load(void);
109 virtual void Shutdown(void);
110
112 virtual void ServerActivate(void);
114 virtual void LateActivate(void);
115
117 virtual bool ConsoleCommand(ncPlayer,string);
119 virtual bool ClientCommand(ncClient, string);
121 virtual void PlayerConnect(ncPlayer);
123 virtual void PlayerDisconnect(ncPlayer);
125 virtual void PlayerSpawn(ncPlayer);
127 virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string);
129 virtual void NPCDeath(ncActor, ncEntity, ncEntity);
130
132 virtual void LinkProgs(void);
133
137 nonvirtual ncAddonDelegate CreateFromProgs(string addonName, float progsHandle);
138
140 nonvirtual void Close(void);
141
143 nonvirtual string Name(void);
144
145private:
146 float m_progHandle;
147 string m_name;
148};
149
150#define ADDON_LINK(y, z) this.y = externvalue(m_progHandle, z); if (!this.y) { this.y = ncAddonDelegate::y; }
This entity class represents an object with choreographed/free-form movement.
Definition: Actor.h:93
This is a delegate class for individual active AddonC plugins.
Definition: AddonDelegate.h:102
virtual void ServerActivate(void)
Overridable: Called when the server gets activated and the addon is loaded alongside with it.
Definition: AddonDelegate.qc:37
virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string)
Overridable: Called when a ncPlayer dies in the game.
Definition: AddonDelegate.qc:79
nonvirtual void Close(void)
Closes the addon.
Definition: AddonDelegate.qc:95
nonvirtual ncAddonDelegate CreateFromProgs(string addonName, float progsHandle)
Creates an addon delegate from a progs handle.
Definition: AddonDelegate.qc:123
nonvirtual string Name(void)
Returns the name of the addon.
Definition: AddonDelegate.qc:89
virtual bool ClientCommand(ncClient, string)
Overridable: Called when a client issues a client command.
Definition: AddonDelegate.qc:58
virtual void Load(void)
Overridable: Called when the plugin gets loaded.
Definition: AddonDelegate.qc:32
virtual bool ConsoleCommand(ncPlayer, string)
Overridable: Called when the server issues a console command.
Definition: AddonDelegate.qc:52
virtual void PlayerDisconnect(ncPlayer)
Overridable: Called when a ncPlayer leaves the server.
Definition: AddonDelegate.qc:69
void ncAddonDelegate(void)
Definition: AddonDelegate.qc:24
virtual void LateActivate(void)
Overridable: Called when the addon is loaded after server activation.
Definition: AddonDelegate.qc:42
virtual void LinkProgs(void)
Called to link functions defined within multiprogs with the delegate's methods.
Definition: AddonDelegate.qc:107
virtual void Shutdown(void)
Overridable: Called when the plugin gets unloaded.
Definition: AddonDelegate.qc:47
virtual void PlayerConnect(ncPlayer)
Overridable: Called when a ncPlayer joins the server.
Definition: AddonDelegate.qc:64
virtual void PlayerSpawn(ncPlayer)
Overridable: Called when a ncPlayer spawns, called sometime after joining.
Definition: AddonDelegate.qc:84
virtual void NPCDeath(ncActor, ncEntity, ncEntity)
Overridable:: Called when an NPC gets killed.
Definition: AddonDelegate.qc:74
This entity class is the lowest client/player class.
Definition: Client.h:34
ncEntity is the lowest of the user-accessible entity class.
Definition: Entity.h:75
This entity class represents every player client.
Definition: Player.h:142