Before I say anything I should point out that I am no wizard and am learning most things from poking @Alex. to the point of his insanity and taking apart existing FLHook plugins. The purpose of this thread is to allow me to dumb anything I do in one place. If you have a simple-ish idea, feel free to suggest it - but, take note, a lot of my stuff is taken from Alley's plugin and Cannon's PlayerCtrl due to my inexperience, I am more than happy to try most things, however. ^-^
With that being said, allow me to post some stuff.
void __stdcall HkIServerImpl::Shutdown(void)
- called when flserver shuts down
bool __stdcall HkIServerImpl::Startup(struct SStartupInfo const &p1)
- called when flserver starts up, prior to loading chars and FL data
bool __stdcall HkIServerImpl::Startup_AFTER(struct SStartupInfo const &p1)
- here, everything should be loaded
int __stdcall HkIServerImpl::Update()
- called on every flserver "tick" (install your timers here if you have any)
void __stdcall HkIServerImpl::SubmitChat(CHAT_ID, unsigned long, void const *,CHAT_ID,int)
void __stdcall HkIServerImpl::SubmitChat_AFTER(CHAT_ID, unsigned long, void const *,CHAT_ID,int)
void __stdcall HkIServerImpl::PlayerLaunch(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::PlayerLaunch_AFTER(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::FireWeapon(unsigned int iClientID, struct XFireWeaponInfo const &wpn)
void __stdcall HkIServerImpl::FireWeapon_AFTER(unsigned int iClientID, struct XFireWeaponInfo const &wpn)
void __stdcall HkIServerImpl::SPMunitionCollision(struct SSPMunitionCollisionInfo const & ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPMunitionCollision_AFTER(struct SSPMunitionCollisionInfo const & ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjUpdate(struct SSPObjUpdateInfo const &ui, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjUpdate_AFTER(struct SSPObjUpdateInfo const &ui, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjCollision(struct SSPObjCollisionInfo const &ci, unsigned int iClientID)
void __stdcall HkIServerImpl::SPObjCollision_AFTER(struct SSPObjCollisionInfo const &ci, unsigned int iClientID)
void __stdcall HkIServerImpl::LaunchComplete(unsigned int iBaseID, unsigned int iShip)
void __stdcall HkIServerImpl::LaunchComplete_AFTER(unsigned int iBaseID, unsigned int iShip)
void __stdcall HkIServerImpl::CharacterSelect(struct CHARACTER_ID const & cId, unsigned int iClientID)
void __stdcall HkIServerImpl::CharacterSelect_AFTER(struct CHARACTER_ID const & cId, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseEnter(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseEnter_AFTER(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseExit(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::BaseExit_AFTER(unsigned int iBaseID, unsigned int iClientID)
void __stdcall HkIServerImpl::OnConnect(unsigned int)
void __stdcall HkIServerImpl::OnConnect_AFTER(unsigned int)
void __stdcall HkIServerImpl::DisConnect(unsigned int iClientID, enum EFLConnection p2)
void __stdcall HkIServerImpl::DisConnect_AFTER(unsigned int iClientID, enum EFLConnection p2)
void __stdcall HkIServerImpl::TerminateTrade(unsigned int iClientID, int iAccepted)
void __stdcall HkIServerImpl::TerminateTrade_AFTER(unsigned int iClientID, int iAccepted)
void __stdcall HkIServerImpl::InitiateTrade(unsigned int iClientID1, unsigned int iClientID2)
void __stdcall HkIServerImpl::InitiateTrade_AFTER(unsigned int iClientID1, unsigned int iClientID2)
void __stdcall HkIServerImpl::ActivateEquip(unsigned int iClientID, struct XActivateEquip const &aq)
void __stdcall HkIServerImpl::ActivateEquip_AFTER(unsigned int iClientID, struct XActivateEquip const &aq)
void __stdcall HkIServerImpl::ActivateCruise(unsigned int iClientID, struct XActivateCruise const &ac)
void __stdcall HkIServerImpl::ActivateCruise_AFTER(unsigned int iClientID, struct XActivateCruise const &ac)
void __stdcall HkIServerImpl::ActivateThrusters(unsigned int iClientID, struct XActivateThrusters const &at)
void __stdcall HkIServerImpl::ActivateThrusters_AFTER(unsigned int iClientID, struct XActivateThrusters const &at)
void __stdcall HkIServerImpl::GFGoodSell(struct SGFGoodSellInfo const &gsi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodSell_AFTER(struct SGFGoodSellInfo const &gsi, unsigned int iClientID)
void __stdcall HkIServerImpl::CharacterInfoReq(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::CharacterInfoReq_AFTER(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::JumpInComplete(unsigned int iSystemID, unsigned int iShip)
void __stdcall HkIServerImpl::JumpInComplete_AFTER(unsigned int iSystemID, unsigned int iShip)
void __stdcall HkIServerImpl::SystemSwitchOutComplete(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::SystemSwitchOutComplete_AFTER(unsigned int iShip, unsigned int iClientID)
void __stdcall HkIServerImpl::Login(struct SLoginInfo const &li, unsigned int iClientID)
- plugins are called after this function! if you need handling before this function, use OnConnect (HkKick and other player related commands dont work without login)
void __stdcall HkIServerImpl::Login_AFTER(struct SLoginInfo const &li, unsigned int iClientID)
- this is called after LoadUserSettings, so char-settings are loaded with this hook
void __stdcall HkIServerImpl::MineAsteroid(unsigned int p1, class Vector const &vPos, unsigned int iLookID, unsigned int iGoodID, unsigned int iCount, unsigned int iClientID)
void __stdcall HkIServerImpl::MineAsteroid_AFTER(unsigned int p1, class Vector const &vPos, unsigned int iLookID, unsigned int iGoodID, unsigned int iCount, unsigned int iClientID)
void __stdcall HkIServerImpl::GoTradelane(unsigned int iClientID, struct XGoTradelane const >l)
void __stdcall HkIServerImpl::GoTradelane_AFTER(unsigned int iClientID, struct XGoTradelane const >l)
void __stdcall HkIServerImpl::StopTradelane(unsigned int iClientID, unsigned int p2, unsigned int p3, unsigned int p4)
void __stdcall HkIServerImpl::StopTradelane_AFTER(unsigned int iClientID, unsigned int p2, unsigned int p3, unsigned int p4)
void __stdcall HkIServerImpl::AbortMission(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::AbortMission_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::AcceptTrade(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::AcceptTrade_AFTER(unsigned int iClientID, bool p2)
void __stdcall HkIServerImpl::AddTradeEquip(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::AddTradeEquip_AFTER(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::BaseInfoRequest(unsigned int p1, unsigned int p2, bool p3)
void __stdcall HkIServerImpl::BaseInfoRequest_AFTER(unsigned int p1, unsigned int p2, bool p3)
void __stdcall HkIServerImpl::CreateNewCharacter(struct SCreateCharacterInfo const & scci, unsigned int iClientID)
void __stdcall HkIServerImpl::CreateNewCharacter_AFTER(struct SCreateCharacterInfo const & scci, unsigned int iClientID)
void __stdcall HkIServerImpl::DelTradeEquip(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::DelTradeEquip_AFTER(unsigned int iClientID, struct EquipDesc const &ed)
void __stdcall HkIServerImpl::DestroyCharacter(struct CHARACTER_ID const &cId, unsigned int iClientID)
void __stdcall HkIServerImpl::DestroyCharacter_AFTER(struct CHARACTER_ID const &cId, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodBuy(struct SGFGoodBuyInfo const &gbi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodBuy_AFTER(struct SGFGoodBuyInfo const &gbi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodVaporized(struct SGFGoodVaporizedInfo const &gvi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFGoodVaporized_AFTER(struct SGFGoodVaporizedInfo const &gvi, unsigned int iClientID)
void __stdcall HkIServerImpl::GFObjSelect(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::GFObjSelect_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::Hail(unsigned int p1, unsigned int p2, unsigned int p3)
void __stdcall HkIServerImpl::Hail_AFTER(unsigned int p1, unsigned int p2, unsigned int p3)
void __stdcall HkIServerImpl::InterfaceItemUsed(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::InterfaceItemUsed_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::JettisonCargo(unsigned int iClientID, struct XJettisonCargo const &jc)
void __stdcall HkIServerImpl::JettisonCargo_AFTER(unsigned int iClientID, struct XJettisonCargo const &jc)
void __stdcall HkIServerImpl::LocationEnter(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationEnter_AFTER(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationExit(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationExit_AFTER(unsigned int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::LocationInfoRequest(unsigned int p1,unsigned int p2, bool p3)
void __stdcall HkIServerImpl::LocationInfoRequest_AFTER(unsigned int p1,unsigned int p2, bool p3)
void __stdcall HkIServerImpl::MissionResponse(unsigned int p1, unsigned long p2, bool p3, unsigned int iClientID)
void __stdcall HkIServerImpl::MissionResponse_AFTER(unsigned int p1, unsigned long p2, bool p3, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqAddItem(unsigned int p1, char const *p2, int p3, float p4, bool p5, unsigned int p6)
void __stdcall HkIServerImpl::ReqAddItem_AFTER(unsigned int p1, char const *p2, int p3, float p4, bool p5, unsigned int p6)
void __stdcall HkIServerImpl::ReqChangeCash(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqChangeCash_AFTER(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqCollisionGroups(class std::list<struct CollisionGroupDesc,class std::allocator<struct CollisionGroupDesc> > const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqCollisionGroups_AFTER(class std::list<struct CollisionGroupDesc,class std::allocator<struct CollisionGroupDesc> > const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqEquipment(class EquipDescList const &edl, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqEquipment_AFTER(class EquipDescList const &edl, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqHullStatus(float p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqHullStatus_AFTER(float p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqModifyItem(unsigned short p1, char const *p2, int p3, float p4, bool p5, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqModifyItem_AFTER(unsigned short p1, char const *p2, int p3, float p4, bool p5, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqRemoveItem(unsigned short p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqRemoveItem_AFTER(unsigned short p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqSetCash(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqSetCash_AFTER(int p1, unsigned int iClientID)
void __stdcall HkIServerImpl::ReqShipArch(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::ReqShipArch_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::RequestBestPath(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestBestPath_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestCancel(int iType, unsigned int iShip, unsigned int p3, unsigned long p4, unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCancel_AFTER(int iType, unsigned int iShip, unsigned int p3, unsigned long p4, unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCreateShip(unsigned int iClientID)
void __stdcall HkIServerImpl::RequestCreateShip_AFTER(unsigned int iClientID)
void __stdcall HkIServerImpl::RequestEvent(int p1, unsigned int p2, unsigned int p3, unsigned int p4, unsigned long p5, unsigned int p6)
void __stdcall HkIServerImpl::RequestEvent_AFTER(int p1, unsigned int p2, unsigned int p3, unsigned int p4, unsigned long p5, unsigned int p6)
void __stdcall HkIServerImpl::RequestGroupPositions(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestGroupPositions_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestPlayerStats(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestPlayerStats_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestRankLevel(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestRankLevel_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::RequestTrade(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::RequestTrade_AFTER(unsigned int p1, unsigned int p2)
void __stdcall HkIServerImpl::SPRequestInvincibility(unsigned int iShip, bool p2, enum InvincibilityReason p3, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestInvincibility_AFTER(unsigned int iShip, bool p2, enum InvincibilityReason p3, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestUseItem(struct SSPUseItem const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::SPRequestUseItem_AFTER(struct SSPUseItem const &p1, unsigned int iClientID)
void __stdcall HkIServerImpl::SPScanCargo(unsigned int const &p1, unsigned int const &p2, unsigned int p3)
void __stdcall HkIServerImpl::SPScanCargo_AFTER(unsigned int const &p1, unsigned int const &p2, unsigned int p3)
void __stdcall HkIServerImpl::SetInterfaceState(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetInterfaceState_AFTER(unsigned int p1, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetManeuver(unsigned int iClientID, struct XSetManeuver const &p2)
void __stdcall HkIServerImpl::SetManeuver_AFTER(unsigned int iClientID, struct XSetManeuver const &p2)
void __stdcall HkIServerImpl::SetTarget(unsigned int iClientID, struct XSetTarget const &p2)
void __stdcall HkIServerImpl::SetTarget_AFTER(unsigned int iClientID, struct XSetTarget const &p2)
void __stdcall HkIServerImpl::SetTradeMoney(unsigned int iClientID, unsigned long p2)
void __stdcall HkIServerImpl::SetTradeMoney_AFTER(unsigned int iClientID, unsigned long p2)
void __stdcall HkIServerImpl::SetVisitedState(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetVisitedState_AFTER(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetWeaponGroup(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::SetWeaponGroup_AFTER(unsigned int iClientID, unsigned char *p2, int p3)
void __stdcall HkIServerImpl::StopTradeRequest(unsigned int iClientID)
void __stdcall HkIServerImpl::StopTradeRequest_AFTER(unsigned int iClientID)
void __stdcall HkIServerImpl::TractorObjects(unsigned int iClientID, struct XTractorObjects const &p2)
void __stdcall HkIServerImpl::TractorObjects_AFTER(unsigned int iClientID, struct XTractorObjects const &p2)
void __stdcall HkIServerImpl::TradeResponse(unsigned char const *p1, int p2, unsigned int iClientID)
void __stdcall HkIServerImpl::TradeResponse_AFTER(unsigned char const *p1, int p2, unsigned int iClientID)
void __cdecl HkCb_Update_Time(double dInterval)
void __cdecl HkCb_Update_Time_AFTER(double dInterval)
- update timing hook, original function call: Timing::UpdateGlobalTime(dInterval)
void __stdcall HkCb_Elapse_Time(float p1)
void __stdcall HkCb_Elapse_Time_AFTER(float p1)
- main worker function for npcs, physics engine, etc; original function call: Server.ElapseTime(p1)
int __cdecl HkCb_Dock_Call(unsigned int const &uShipID,unsigned int const &uSpaceID,int p3,enum DOCK_HOST_RESPONSE p4)
- called on every docking behaviour (entering queue, etc..) of players and npcs
original function call: pub::SpaceObj::Dock(uShipID,uSpaceID,p3,p4)
bool __stdcall LaunchPosHook(uint iSpaceID, struct CEqObj &p1, Vector &p2, Matrix &p3, int iDock)
- called when any ship launches from an object to determine the launch position
original function call: p1.launch_pos(p2,p3,iDock)
bool AllowPlayerDamage(uint iClientID, uint iClientIDTarget)
- control player damage here without messing with the other damage functions
void SendDeathMsg(const wstring &wscMsg, uint iSystemID, uint iClientIDVictim, uint iClientIDKiller)
- alter the way death messages are sent here
bool UserCmd_Process(uint iClientID, const wstring &wscCmd)
- you can insert your own usercommands here without messing with SubmitChat (true return indicates a handled usercommand)
void UserCmd_Help(uint iClientID, const wstring &wscParam)
- called on the help command, insert here your own implemented commands (with PrintUserCmdText)
void ClearClientInfo(uint iClientID)
- called when a new player connects to the server, reset any player specific data here
void LoadSettings()
- called on FLHook/FLServer startup and everytime the rehash command is used, load/reload your settings here
bool ExecuteCommandString_Callback(CCmds* classptr, const wstring &wscCmdStr)
- insert your own admin commands here, use NOFUNCTIONCALL returncode and a true return value to indicate a handled command
void CmdHelp_Callback(CCmds* classptr)
- admin help command callback (print your added admin commands here), returncode doesnt matter
void BaseDestroyed(uint iObject, uint iClientIDBy)
- called when a dockable base is destroyed (iObject is SpaceID)
A configurable help menu that can have whatever text inserted into each command via a helpful config file.
/myrep will display every faction's rep relative to the player and sort it from most hostile to most friendly.
Like the first one, but a bit more pretty, this one is a configurable list of laws for each faction that has them.
Most of this code was stolen from Alley's event plugin. <3
Skorak Wrote:/contraband_li - A command to pull a list of contraband items for the house suffix.
Idea from Skorak.
Feel free to offer feedback and suggestions. This stuff is still really basic.
Don't even bother asking for docking modules, I'm not smart enough for that stuff.
(11-28-2017, 10:41 PM)Freeroamer Wrote: Not bad. If only contraband lists actually got updated.
Not my problem.
(11-28-2017, 10:31 PM)Regulus Wrote: For /myrep, i would like to have it sorted by factions names.
No. It took long enough to sort it this way around.
(11-28-2017, 10:31 PM)Regulus Wrote: For /contraband_xx, can the text be in dsace.log too ?
We could, but I think it is a lot cleaner like this. You don't really need it in the dsace as you have the forums with the information. If it would be implemented it would make sense for it to be a little reminder for those that are trying to enforce laws, there and then.