This repository was archived by the owner on Dec 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Events
RadWolfie edited this page Jan 10, 2014
·
6 revisions
Native events coming from Halo Server. (Yes, including from client's host as well.)
NOTICE 1: Everything here are absolutely optional.
NOTICE 2: This is updated for Add-on API 3.1 . Plus 4 additional hooks for 0.5.1.2 and higher.
extern "C" __declspec(dllexport) toggle EXTOnPlayerJoinEvent(IPlayer::PlayerInfo plI) {
return EAOCONTINUE; // Acceptable EAOCONTINUE | EAOOVERRIDE
}
extern "C" __declspec(dllexport) toggle EXTOnPlayerQuitEvent(IPlayer::PlayerInfo plI) {
return EAOCONTINUE; // Acceptable EAOCONTINUE | EAOOVERRIDE
}
extern "C" __declspec(dllexport) void EXTOnPlayerDeath(IPlayer::PlayerInfo killer, IPlayer::PlayerInfo victim, int mode, bool* showMessage) {
// Use showMessage boolean to false if do not want to output the default death message. (You can use a customize messages here.)
}
extern "C" __declspec(dllexport) bool EXTOnPlayerChangeTeamAttempt(IPlayer::PlayerInfo plI, int team) {
return true; // return true if permit to change team, return false to deny change team.
}
extern "C" __declspec(dllexport) int EXTOnPlayerJoinDefault(MachineHeader* mH, int current_team) {
return -1; // See list below for return value acceptable.
/* (NOTICE: This is called first before EXTOnPlayerJoinEvent event.)
* Acceptable return values
* -1 = default as defined in current_team
* 0 = enforce on red team
* 1 = enforce on blue team
*/
}
extern "C" __declspec(dllexport) void EXTOnNewGame(wchar_t* map) {
//Will be removed in 0.6.0 and later
}
extern "C" __declspec(dllexport) void EXTOnEndGame(int mode) {
/* mode is only output 0, 1, and 2.
* 0 = game finished
* 1 = Scoreboard (does not permit leave game.)
* 2 = Same as 1 except do allow leave the game.
*/
}
extern "C" __declspec(dllexport) void EXTOnServerIdle(void) {
// No map to run and cause the server to be idled.
}
// NOTICE: May subject to change. We haven't fully test this with other interfaces than weapons. Vehicles are called in different event.
extern "C" __declspec(dllexport) bool EXTOnObjectInteraction(IPlayer::PlayerInfo plI, ident obj_id, ObjectS* obj_struct, IObject::hTagHeader* hTag) {
return true; // return true if permit to interact, return false to deny interact.
}
extern "C" __declspec(dllexport) void EXTOnWeaponAssignmentDefault(IPlayer::PlayerInfo plI, ident owner_obj_id, IObject::objInfo* cur_weap_id, DWORD order, ident& new_weap_id) {
//Only contains 2 available to equipped by gametype's generic weapons. Check for new_weap_id is -1 before you can change the weapon.
return -1;
}
// NOTICE: This is called AFTER EXTOnWeaponAssignmentDefault.
extern "C" __declspec(dllexport) void EXTOnWeaponAssignmentCustom(IPlayer::PlayerInfo plI, ident owner_obj_id, ident* cur_weap_id, DWORD order, ident new_weap_id) {
//Only contains 4 available to equipped by gametype's custom weapons. Check for new_weap_id is -1 before you can change the weapon.
return -1;
}
extern "C" __declspec(dllexport) bool EXTOnPlayerScoreCTF(IPlayer::PlayerInfo plI, bool isGameObject) {
return true; // return true to allow score the flag, return false to deny score the flag. (Useful when check with isGameObject to check if the flag really is for the "CTF" usage.)
}
extern "C" __declspec(dllexport) bool EXTOnPlayerDropObject(IPlayer::PlayerInfo plI, ident owner_obj_id, BipedS* pl_Biped) {
return true; // return true to allow player drop an object, return false to enforce player keep it. (NOTICE: returning false is sync with the clients.)
}
extern "C" __declspec(dllexport) void EXTOnPlayerSpawn(IPlayer::PlayerInfo plI, ident owner_obj_id, BipedS* pl_Biped) {
// For player's join and after death.
}
// May subject to change for better name.
extern "C" __declspec(dllexport) bool EXTOnVehicleUserEntry(IPlayer::PlayerInfo plI, bool forceEntry) {
return true; // return true to allow enter the vehicle, return false to prevent enter the vehicle.
// if forceEntry is true, cannot prevent player to enter the vehicle.
}
// May subject to change for better name.
extern "C" __declspec(dllexport) bool EXTOnPlayerVehicleEject(IPlayer::PlayerInfo plI, bool forceEject) {
return true; // return true to allow enter the vehicle, return false to prevent leave the vehicle.
// if forceEject is true, cannot prevent player to leave the vehicle.
}
extern "C" __declspec(dllexport) bool EXTOnPlayerSpawnColor(IPlayer::PlayerInfo plI, bool isTeamPlay) {
return true; // return true to use default color, return false to use custom color.
}
extern "C" __declspec(dllexport) toggle EXTOnPlayerValidateConnect(IPlayer::PlayerExtended plEx, MachineHeader mH, banCheckStruct banCheckPlayer, bool isBanned, toggle svPass, toggle isForceReject) {
return 0; // Acceptable values below. NOTICE: if isForceReject is 0, you can change the return. If it is other than 0, you cannot change the return.
//if 0 = default (follow by halo's default method)
//if 1 = is banned (denied)
//if 2 = password reject (denied)
//if 3 = bypass the gamespy validate (accepted)
//if 4 = do gamespy validate (accepted)
//if svPass = 1, client has passed the server password lock. (by default, will accept client)
//if svPass = 0, server password isn't set. (by default, will accept client)
//if svPass = -1, client failed the server password lock. (by default, will reject client)
}
extern "C" __declspec(dllexport) bool EXTOnWeaponReload(ObjectS *, bool allowReload) {
return true; //Return true if allow to reload. Return false if deny to reload; (NOTICE: This also affect the vehicle's weaponary too.)
}
extern "C" __declspec(dllexport) void EXTOnKillMultiplier(IPlayer::PlayerInfo killer, DWORD multiplier) {
}
extern "C" __declspec(dllexport) bool EXTOnObjectDamageLookupProcess(IObject::objDamageInfo& damageInfo, ident& obj_recv, bool& allowDamage, bool isManaged) {
return true; // Return true if not managed. Return false if managed. (NOTICE: watch for isManaged value if state as true.)
}
extern "C" __declspec(dllexport) bool EXTOnObjectDamageApplyProcess(const IObject::objDamageInfo& damageInfo, ident& obj_recv, IObject::objHitInfo& hitInfo, bool& allowDamage, bool isManaged) {
return true; // Return true if not managed. Return false if managed. (NOTICE: watch for isManaged value if state as true.)
}
//New hook for 0.5.1.2
extern "C" __declspec(dllexport) void EXTOnMapLoad(ident mapTag, const wchar_t mapName[32]) {
// Will be replacement of EXTOnNewGame.
}
//New hook for 0.5.1.2
extern "C" __declspec(dllexport) bool EXTOnVehicleAIEntry(ident bipedTag, ident vehicleTag, WORD seatNum, toggle isManaged) {
return -1; // Return -1 if not managed. Return 0 to force not permit enter the vehicle. Return 1 to force permit enter the vehicle. (NOTICE: Watch for isManaged if state other than -1)
}
//New hook for 0.5.1.2
extern "C" __declspec(dllexport) bool EXTOnEquipmentDropCurrent(IPlayer::PlayerInfo plI, ident bipedTag, BipedS* biped, ident equipmentTag, WeaponS* equipmentTag, toggle isManaged) {
return -1; // Return -1 if not managed. Return 0 to force delete equipment. Return 1 to force drop equipment. (NOTICE: Watch for isManaged if state other than -1)
}
//New hook for 0.5.1.2
extern "C" __declspec(dllexport) bool EXTOnServerStatus(int execId, toggle isManaged) {
return -1; // Return -1 if not managed. Return 0 to force not to show status message. Return 1 to force show status message. (NOTICE: Watch for isManaged if state other than -1)
}
Halo Extension events for flexibility needed to call directly without the need of additional thread to monitor.
NOTICE #1: This may subject to change at any time for additional features.
extern "C" __declspec(dllexport) void EXTOnLoopEvent() {
}
NOTICE: This may subject to change at any time, make sure your plugin is up to date in order to avoid any conflict.