Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.43k stars 382 forks source link

Rework '/invade' to not disable the previous invasion. #1403

Closed tlworks closed 6 years ago

tlworks commented 7 years ago

Basically, if there's an pirate invasion going on and you would like to have a martian invasion and issue the command '/invade martians' it will only disable the pirate invasion as the command '/invade' was made to disable the ongoing event if there was one going on. I think it's better to add a parameter to use '/invade stop' rather than just invade as multiple invasions going on at once do not cause issues.

AxisKriel commented 7 years ago

Well, you will be reaching the NPC limit and the invasions will be hindered as a result, I still don't think having multiple invasions at once is healthy for this game. How does the client interpret this, does it receive two different invasion meters?

tlworks commented 7 years ago

@Enerdy Yes, multiple invasions are possible. In fact you could have every invasion at once. The NPC cap would indeed get hit but seeing that NPC's come in waves of around 25~30, I don't see this happening quickly with 2 or 3 events going on.

It's just that server timed invasions by command will cancel each other out when there's an event going on.

hakusaro commented 6 years ago

It isn't currently possible in Terraria to have multiple game orchestrated invasions happening at the same time. There are only a handful of fields in Terraria.Main that detail with invasions:

Main.invasionType
Main.invasionSize
Main.invasionSizeStart
Main.invasionProgress
Main.invasionProgressIcon
...

There is only one of each field. If you change any of them, you change the current invasion. You can't have multiple. To boot, Main.StartInavsion will reset all of these variables, so even if you could have multiple invasions, you would have to re-implement Main.StartInvasion.