Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
It seems like cClientHandle::SendConfirmPosition() is not referenced anywhere in MCServer which causes the plugin hook HOOK_PLAYER_JOIN never to be called.
Should SendConfirmPosition() still be used or should it be removed?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
It should be used in the 1.2.5 protocol, isn't it? If not, does the protocol work?
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Protocol 1.2.5 is not using this function either (at least not directly)
It is used by cClientHandle::CheckIfWorldDownloaded() but it doesn't reach that part of the code when connecting with a 1.3.x client, I can't say about 1.2.5
The main issue with this is that HOOK_PLAYER_JOIN is never called like this. Should the hook be moved somewhere else?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Is the hook needed at all? What is the difference between PLAYER_JOIN and PLAYER_LOGIN? Is there a situation where PLAYER_LOGIN cannot be used in place of PLAYER_JOIN?
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
10-16-2012, 09:50 PM
(This post was last modified: 10-16-2012, 09:50 PM by FakeTruth.)
PLAYER_LOGIN is called before the player is actually spawned in the world, it allows you to do things like whitelisting/banning, changing player names and perhaps invisibly joining the server.
PLAYER_JOIN is called after the player has been spawned. Use this for the MOTD, to give player inventory items or teleport the player somewhere.
The MOTD can probably also be done in PLAYER_LOGIN (if the protocol allows this), but the rest requires different hooks
Posts: 372
Threads: 29
Joined: Mar 2011
Thanks: 1
Given 21 thank(s) in 18 post(s)
Well can we access the Player:SetName() in player_login ?
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Yes you can, but the player has then already been loaded (position, inventory, permissions etc.)
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Alright I move some hooks around