SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

Plugin OnPlayerLeft needs rename to OnPlayerDisposed #85

Closed AlienXAXS closed 10 years ago

AlienXAXS commented 10 years ago

Perhaps not the best name, but OnPlayerLeft gives the idea that the player has left the server - OnPlayerLeft is called as the player object is disposed of, however the player object is disposed of whenever that player enteres a cockpit - thus calling the OnPlayerLeft event. (works every time on the cockpit that you start off with on Easy Start 1 that's attached to the station)

OnPlayerJoined also fires when a player leaves the cockpit.

Perhaps also, a OnPlayerJoinedServer and OnPlayerLeftServer events could be created and fired only when a player acctually leaves and joins the server.

I hope this makes sense :)

chessmaster42 commented 10 years ago

Yeah this is a known problem and is the result of our early code with events. We started work on events long before we had any mapping in the API to link a player's steamid and player id to any in-game objects.

We will be overhauling this eventually and the events will be as such:

OnPlayerJoined - Player joins server OnPlayerLeft - Player leaves server OnCharacterCreated - Character entity is created OnCharacterDeleted - Character entity is disposed

I'll be sure that this issue is updated once the new events have been setup in the API.

AlienXAXS commented 10 years ago

Thanks Chessmaster, this is brilliant news :)

chessmaster42 commented 10 years ago

Completed in 98d4a9e932d640fab6e0822f023b778861e01e2a

Note: The player join/leave events do nothing now as the original function has been moved to the character events. Will have these functional soon though.

chessmaster42 commented 10 years ago

Feature is fully complete and new player events have been finished and tested.