Save all data to files. If player goes offline, info won't be lost.
Support multiple modules with different parameters.
/dockatbase <charname> command to dock to carrier at bases. Carrier player should type /allowdock <charname> to allow docking. POB support is included.
Scanning carrier will display a message with all docked ships enumerated.
Merging undocking mechanics of forced system switch with launch packets. Ships will be jumped to carrier's system if carrier jumps, with current system value in player list also updated.
Cancelable docking requests.
Disable /renameme for docked ships or carriers with docked ships.
Proper handling of removing character who is part of docking modules plugin.
For docking module (type 1) docking radius is decreased to 300 meters and 3-second delay before docking is being set to balance out /loadsupplies feature.
If carrier dies, all ships are being force launched from carrier. If some docked players are offline, all their cargo will be launched in space and their ships moved to last real base they were on like after death.
More friendly jettisoning. Ship will just be instantly force launched without kick timeout. If ship is offline, it will be moved to carrier's current base (you can't jettison offline ships in space to avoid exploiting).
/jettisonallships command
No need of /allowdock command if players are in same group.
Disable notification for carrier if someone requests docking. Ask in chat instead. No request spamming.
Sound accompaniment for main docking module actions. Makes docking modules feel more alive.
POB support. If your last real base was POB, you'll respawn at it if die. If carrier is at POB now, players will be docked to the POB if they launch their ships.
Turn on docking lights on requesting dock to player ship.
Process docking ships by queue as freelancer does originally.
Jettison docked ship if carrier unmounts module with docked ship inside.
Display "Docked to <charname>" in base info for docked ships.
/loadsupplies command to restore ammo and regens for snubs. Requires carrier to have crew on board and some special commodities too (they will be consumed). The more crew - the faster resupplying.
Add exceptions and unique commodities to /loadsupplies for non-trivial IDs, like Nomads or Gammu AI. They may also use proxy bases of different styles, there definitely must be separate style for Nomads.
Solid work. I feel it's worth pointing out, the infinite jump bug has never been reproduced outside the live server. Something to add as well, and I know this isn't you but more a problem with the original plugin (and all plugins made by Cannon for that matter), but you might want to adjust the hardcoded values. There are a lot of them littered throughout the plugin, and if any of them don't exist it'll cause a server/client crash.
(i'm going to keep editing this as I think of more things to add)
I would have personally checked up with devs before posting this, because if it doesn't work (and I doubt it fixes the infinite jump bug if I'm being truly honest), it gives people false hope. Even after I've stopped doing dev work I am still asked to rewrite this plugin at least once a week (I don't even see the appeal in it tbh).
You've changed some of the returncodes to nofunctioncall and this will cause plugin conflicts. You really shouldn't do that unless you are absolutely sure the action wont be used in more than once place. I.e. the dock_call function call could have a massive fit if someone tries to dock while having a pending request. LaunchPosHook can bug up with PoBs since they both use the same structure as the temp ship store.
Looking at your code, you are creating new threads. You need to do proper thread management if you go down the route of multi-threaded behaviour because this code would absolutely not scale well. Like, I really need to stress that. You need to properly terminate your threads and not create one inside a for loop! Small scale, threads work quite well and it's difficult to see where errors may appear. But I'm reasonably confident, looking at your code, that this would scale horrible on the live server, given how many threads you are creating, and how you are just letting them run, rather than properly identifying, segregating, detaching, and terminating them.
Hm, I've read about docking module concept.
Seems fairly interesting, but, as far as I heard it's bugged. Is it fixed now? It sounds very interesting to have a thing that allows others to dock on player ship.
(06-09-2019, 06:31 PM)Laz Wrote: I doubt it fixes the infinite jump bug if I'm being truly honest
I don't actually known where is the problem. I thought and decided to completely remove the function that is responsible for forced change of systems, since bugs occur during this. I want to test it at separate server with all private plugins enabled and look at result. If the bug is present after this, I will try to fix it again.
(06-09-2019, 06:31 PM)Laz Wrote: LaunchPosHook can bug up with PoBs since they both use the same structure as the temp ship store.
Maybe it is possible. Would be great if you tell me other, safe and nice way to teleport player ship to carrier.
(06-09-2019, 06:31 PM)Laz Wrote: You've changed some of the returncodes to nofunctioncall and this will cause plugin conflicts.
Codes were put back.
(06-09-2019, 06:31 PM)Laz Wrote: I.e. the dock_call function call could have a massive fit if someone tries to dock while having a pending request.
Fixed.
(06-09-2019, 06:31 PM)Laz Wrote: Looking at your code, you are creating new threads. You need to do proper thread management if you go down the route of multi-threaded behaviour because this code would absolutely not scale well.
Totally forgot about HkTimerCheckKick, all delayed actions were rewritten using this hook. Scaling problem solved.
(06-09-2019, 11:05 PM)Its Raisu Wrote: Hindsight: Probably would have been better to have put this on a Github that way changes could be seen easily.
The link is updated. Now it leads to repository at new GitHub account.
Note: I uploaded all files, but after putting some more changes. They are noted in readme.