Id is returning 0. (not null, btw.. I checked..)
I've tried several ways. Also to be noted -- (ClientInfo) client.steamId.m_SteamID seems to be returning 0.
In the server console, I clearly see my character's Entity object as 171 and my correct Steam ID.
I tried restarting the server a couple times around my tests.
Anyway, I pulled my hair out over it for several hours last week before finally just hard-coding a work-around. My code not working as intended atm.
I was getting the client info from within OnPlayerChat. Other methods from IPlayer were working as intended. Message was working, Teleport working, Position is also working.
Example test code --
Results in --
You typed blah.
Player ID is 0 -- client info player id is 0
I checked my pDataFile where I store coords, it stores it under the pair "0", "savepos". (as opposed to the steamID "7xxxxxxxxxxxxxxx", "savepos".) (sorry I haven't memorized my steamID yet...)
hmm.. in that string I guess I should have said "client info steam id is {1}" .. oh well.. potato Po-tot-toe..
Thanks!
Rog
I've tried several ways. Also to be noted -- (ClientInfo) client.steamId.m_SteamID seems to be returning 0.
In the server console, I clearly see my character's Entity object as 171 and my correct Steam ID.
I tried restarting the server a couple times around my tests.
Anyway, I pulled my hair out over it for several hours last week before finally just hard-coding a work-around. My code not working as intended atm.
I was getting the client info from within OnPlayerChat. Other methods from IPlayer were working as intended. Message was working, Teleport working, Position is also working.
Example test code --
void OnPlayerChat( ClientInfo ci, string message )
{
if ( (ci != null) && (ci.IPlayer.Id != null) && (ci.steamId.m_SteamID != null) )
{
ci.IPlayer.Message( "You typed {0}.", "", message );
ci.IPlayer.Message( "Player ID is {0} -- client info player id is {1}", "", ci.IPlayer.Id, ci.steamId.m_SteamID );
}
}
Results in --
You typed blah.
Player ID is 0 -- client info player id is 0
I checked my pDataFile where I store coords, it stores it under the pair "0", "savepos". (as opposed to the steamID "7xxxxxxxxxxxxxxx", "savepos".) (sorry I haven't memorized my steamID yet...)
hmm.. in that string I guess I should have said "client info steam id is {1}" .. oh well.. potato Po-tot-toe..
Thanks!
Rog