View Full Version : User.isHost has some unexpected behavior for me
SilentRuin
June 26th, 2020, 01:30
[EDIT: TURNS out this was all console logs writing all the logs to one place (host and player)]
As I develop extensions I always run my host, and a player. Two separate instances of the game. One to load the campaign - the other to host.
I was pretty surprised when I put in User.isHost guards in my code and the player instance simply seemed to thing they were the host.
Technically, the user SilentRuin is running both the load campaign and the join. But I was hoping it would tell me who was actually the host (load of campaign). It seems confused since my name is technically both.
Is there a way to truly and absolutely tell the code who is the host and who is the player?
Moon Wizard
June 26th, 2020, 01:33
I've never seen that before. If that was the case, then a lot of the core ruleset code wouldn't work correctly.
Can you create a minimal extension that recreates the issue?
Regards,
JPG
SilentRuin
June 26th, 2020, 01:44
I've never seen that before. If that was the case, then a lot of the core ruleset code wouldn't work correctly.
Can you create a minimal extension that recreates the issue?
Regards,
JPG
Something else must be going on - I was looking at compile logs and it looked like my player was running through all the host calls - but now that I've printed out the isHost value - its doing the right thing. Something else is going on - probably in the stupid category - sorry to have wasted your time. You can delete this thread if you wish.
SilentRuin
June 26th, 2020, 01:50
Wow my compile logs are showing crazy stuff... I've got a DB.handler that i was originally processing only at the host when a database value changed for any character. But then I realized I had to have players check one value so made it happen for everyone, just the players ingored the bulk of the code and only processed one tiny section.
But when I just compiled the logs on the players side I saw this from the debug.console I have at the top of the DB.handlers call (prints out isHost).
[6/25/2020 7:41:51 PM] isHost was false'
... a few other log prints per normal ... then ...
[6/25/2020 7:41:51 PM] isHost was true'
I'll have to add more logs and figure out what is happening.
SilentRuin
June 26th, 2020, 02:09
ARRGGHHHH... this is some kind of compile logs artifact I've been churning on. If I compile logs on SilentRuin the player - I see the 4 places I put isHost result logs as false 1st/true 1st/true 2nd/true 3rd/true 4th all in the console log I generated from the player.
Compiled the logs from the host - and got the EXACT some console log.
This is probably because the console log is simply writing everything from my player an host to the same file making my logs useless the way I'm running (sigh).
damned
June 27th, 2020, 01:43
I dont think the console log can differentiate between two instances of FG on teh same computer.
SilentRuin
June 27th, 2020, 05:45
I dont think the console log can differentiate between two instances of FG on teh same computer.
I can verify it doesn't. Just have to put very clear logging to keep the threads readable. Confused me when I thought it was just the instance I was compiling the logs from. My bad.
Moon Wizard
June 27th, 2020, 09:10
If you're running two copies of FG on the same machine; they are both writing to the same log files, since they both have the same Settings.
Regards,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.