otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.6k stars 1.07k forks source link

login / exit enhancements #870

Open Zbizu opened 10 years ago

Zbizu commented 10 years ago

It is ok to keep monster attacked when player lost connection or exited without logging out, but:

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

yrpen commented 10 years ago

Also should be possible too disable/enable both config.lua

WibbenZ commented 10 years ago

Would be good to have and maybe with a config value to de/activate it.

Zbizu commented 10 years ago

Anything else to do here?

andersonfaaria commented 4 years ago

@Zbizu did you managed to do this through Lua?

Zbizu commented 4 years ago

No. I had exams in that school year (notice that you replied to a comment from 6 years ago), then went to university, haven't been present here for years and I forgot that I wrote that comment.

What I currently think about lua version of that:

login: player would either need a temporary flag unattackable or monsters aggression would have to be suppressed then after 10 seconds resumed

2 ways of doing it:

  1. onLogin -> getSpectators -> addEvent
  2. onThink checking last time player logged in (could be very laggy on bigger servers)

exit: also two ways:

  1. (C++) source changes for a stable version that would use functions that were designed for that
  2. (Lua) importing curl and getting a glitchy version that would use Player:getIp() (potential downsides of lua version: unattackable player that wasn't dced)