Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some general function calls for client login/logout at characters. #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tanith87
Copy link
Contributor

f_onchar_login/f_onchar_logout functions (usually placed in sphere_serv_triggers.scp) are now called for clients login/-out at characters. SRC is the character. This is independent from character definition or events to be more reliable.

The reason for this function calls is that there are sometimes cases where a functionality is really scoped to a client. Okay you could use events. But especially our tech staff sometimes makes experiments, and in these cases there are sometimes no events and stuff like that. But a reliable trigger is requred. So here it is.

@coruja747
Copy link
Collaborator

coruja747 commented Nov 3, 2016

that's ok for me, although this code add new f_onchar_login / f_onchar_logout functions without remove the previous one, so these functions will be triggered twice and this could a problem

but probably this could be a problem to some ppl that don't like core changes that modify "old behaviors" and will not like to see f_onchar_[login/logout] getting changed. So I will leave this pull request open, if more devs approve it feel free to merge it on source

PS: you can also simulate an f_onserver_[login/logout] using packet filter, just add "PACKETx=f_custom_login_function" on sphere.ini (the packet number must be decimal 0 ~ 255). Inside the function called by packet filter you can also get a ref to both client / char (I can't remember if the client is the REF1, SRC, ARGO, LOCAL.CLIENT, LOCAL.CHAR, whatever). You can check the packet number here: http://docs.polserver.com/packets/
Keep in mind that the client uses different packets during login behavior (on packet open the 1st connection to loginserver IP, another packet connect on server IP selected on server selection screen, and another packet select the character on character selection screen)

@tanith87
Copy link
Contributor Author

tanith87 commented Nov 5, 2016

Hello, Thanks for your feedback! :-)

I don't get the point why they should get triggered twice? There are two different points to write your code. One at character triggers level and with this pull request one at a server client function level. These are two different things for different purposes, which trigger at the same time.

Regarding your idea to use a packet filter. At first I thought, umh why didn't I thought about this? ;-) This should work for logins of course! But not for logging off when the client connection timed out. There will be no package to filter. ;-) The additional function of the pull request should handle this.

Copy link
Member

@lintax lintax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coruja is right, double-calling can happen. If the shard already has a function named f_onchar_login your new trigger would cause incompatibility problems.
But I really doubt if this is a common issue and since admins anyhow should always check the changelog before updating the server, so I think that request could be safely merged.

@tanith87
Copy link
Contributor Author

tanith87 commented Jun 7, 2017

Merged again. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants