TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
178 stars 74 forks source link

Error with "sv_lan 1" and multiple clients from the same steam account #519

Closed nikosChalk closed 4 years ago

nikosChalk commented 4 years ago

Your version of TTT2 (mandatory)

Leave one of the following:

Describe the bug (mandatory)

The game will not start when the server is started with "sv_lan 1" and 2 clients from the same steam account are in the server. (You may wonder why 2 clients from the same steam account? I am a server owner and it is very common for me to lunch 2 instances of garrys mod to test new stuff)

To reproduce

Steps to reproduce the behaviour:

  1. Start the server with "sv_lan 1"
  2. Launch two instances of garrys mod and connect to the server
  3. Wait for the game to begin

Expected behaviour

The gamemode is supposed to start, but an error occurs in the server

Context

Server console errors:

[TTT2] gamemodes/terrortown/gamemode/server/sv_main.lua:1861: table index is nil
  1. SelectRoles - gamemodes/terrortown/gamemode/server/sv_main.lua:1861
   2. unknown - gamemodes/terrortown/gamemode/server/sv_main.lua:1132

Timer Failed! [prep2begin][@gamemodes/terrortown/gamemode/server/sv_main.lua (line 923)]

Loaded Addons from workshop collection:

Processing addon 21: ULib (557962238)...
Processing addon 20: ULX (557962280)...
Processing addon 19: Hit Numbers (110871780)...
Processing addon 18: Entity Info (500527779)...
Processing addon 17: AntiPlayerStuck (149737736)...
Processing addon 16: Better Water Effects (107901100)...
Processing addon 15: Explosion Effect (127986968)...
Processing addon 14: MysterAC - Particle Enhancer materials (1796166180)...
Processing addon 13: MysterAC New impact effects (1804934154)...
Processing addon 12: Custom ULX Commands (718665054)...
Processing addon 11: ttt_casino_b2 (169342118)...
Processing addon 10: Unstuck Command (1144956657)...
Processing addon 9: TFA Base [ Reduxed ] (415143062)...
Processing addon 8: ttt_Clue_se (281454209)...
Processing addon 7: Gun Stats for TTT and DarkRP (300375321)...
Processing addon 6: MapVote - Fretta-like Map Voting (151583504)...
Processing addon 5: TTT2 (Base) - v0.6.4b - New Roles, Extensible, Better Performance, ULX Support (1357204556)...
Processing addon 4: [TTT2] ULX Commands for TTT2 [FEATURE] (1362430347)...
Processing addon 3: [TTT2] Round Info [FEATURE] (1367128301)...
Processing addon 2: [TTT2] ULX Role Info (1675733457)...
Processing addon 1: Hitmarkers for Gmod! (296385367)...

Additional context

Debugging

Following the error and looking at gamemodes/terrortown/gamemode/server/sv_main.lua:1861, we see that:

print(type(Entity(1):SteamID64()))
> string

print(type(Entity(2):SteamID64()))
> no value
print(Entity(2):Health())
> 100

Meaning that Entity(2):SteamID64() doesn't return a value (?) Entity(2) is the 2nd instance of garry's mod that joined the server

Complete server log

Console initialized.
FIND [D:\css-server\cstrike\*.vpk]
ADDING [D:\css-server\cstrike\cstrike_pak_000.vpk]
Adding Path: [D:\css-server\cstrike]
ConVarRef mat_dxlevel doesn't point to an existing ConVar
Game.dll loaded for "Garry's Mod"
Initializing Steam libraries for Workshop..
WS: Waiting for Steam to log us in.....
WS: Fetching collection info...
Processing collection 2068234737...
   Collection 'nikos-ttt2'
   21 new addons
WS: Finished!

WS: Processing 21 addons...
Processing addon 21: ULib (557962238)...
   Mounted!
Processing addon 20: ULX (557962280)...
   Mounted!
Processing addon 19: Hit Numbers (110871780)...
   Mounted!
Processing addon 18: Entity Info (500527779)...
   Mounted!
Processing addon 17: AntiPlayerStuck (149737736)...
   Mounted!
Processing addon 16: Better Water Effects (107901100)...
   Mounted!
Processing addon 15: Explosion Effect (127986968)...
   Mounted!
Processing addon 14: MysterAC - Particle Enhancer materials (1796166180)...
   Mounted!
Processing addon 13: MysterAC New impact effects (1804934154)...
   Mounted!
Processing addon 12: Custom ULX Commands (718665054)...
   Mounted!
Processing addon 11: ttt_casino_b2 (169342118)...
   Mounted!
Processing addon 10: Unstuck Command (1144956657)...
   Mounted!
Processing addon 9: TFA Base [ Reduxed ] (415143062)...
   Mounted!
Processing addon 8: ttt_Clue_se (281454209)...
   Mounted!
Processing addon 7: Gun Stats for TTT and DarkRP (300375321)...
   Mounted!
Processing addon 6: MapVote - Fretta-like Map Voting (151583504)...
   Mounted!
Processing addon 5: TTT2 (Base) - v0.6.4b - New Roles, Extensible, Better Performance, ULX Support (1357204556)...
   Mounted!
Processing addon 4: [TTT2] ULX Commands for TTT2 [FEATURE] (1362430347)...
   Mounted!
Processing addon 3: [TTT2] Round Info [FEATURE] (1367128301)...
   Mounted!
Processing addon 2: [TTT2] ULX Role Info (1675733457)...
   Mounted!
Processing addon 1: Hitmarkers for Gmod! (296385367)...
   Mounted!
WS: Finished!
Changing gamemode to Trouble in Terrorist Town 2 (terrortown)
Unknown command "ttt_preptime_seconds"
Unknown command "ttt_firstpreptime"
Unknown command "ttt_posttime_seconds"
Unknown command "ttt_haste"
Unknown command "ttt_haste_starting_minutes"
Unknown command "ttt_haste_minutes_per_death"
Unknown command "ttt_roundtime_minutes"
Unknown command "ttt_round_limit"
Unknown command "ttt_time_limit_minutes"
Unknown command "ttt_traitor_pct"
Unknown command "ttt_detective_pct"
Unknown command "ttt_detective_min_players"
Unknown command "ttt_teleport_telefrags"
Unknown command "ttt_idle_limit"
Unknown command "ttt_namechange_bantime"
Unknown command "ttt_ban_type"
Unknown command "ttt_ragdoll_collide"
Unknown command "roundalert_sound"
Unknown command "ttt_sm_duration"
Unknown command "unstuck_cooldown"
Unknown command "entinfo_enabled"
WARNING: Port 27020 was unavailable - bound to port 27021 instead
Network: IP 192.168.141.1, mode MP, dedicated Yes, ports 27055 SV / 27020 CL
Extracting BSP to map.pack in order to mount BSP embedded content...
PREP OK
Couldn't write map.pack to mount embedded content!
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
Failed to load $include VMT file (materials/GLASS/GLASSWINDOW_FROSTED.vmt)
///////////////////////////////
//      Ulysses Library      //
///////////////////////////////
// Loading...                //
//  shared/defines.lua       //
//  shared/misc.lua          //
//  shared/util.lua          //
//  shared/hook.lua          //
//  shared/table.lua         //
//  shared/player.lua        //
//  server/player.lua        //
//  shared/messages.lua      //
//  shared/commands.lua      //
//  server/concommand.lua    //
//  server/util.lua          //
//  shared/sh_ucl.lua        //
//  server/ucl.lua           //
//  server/phys.lua          //
//  server/player_ext.lua    //
//  server/entity_ext.lua    //
//  shared/plugin.lua        //
//  shared/cami_global.lua   //
//  shared/cami_ulib.lua     //
// Load Complete!            //
///////////////////////////////
[ULIB] Loading SHARED module: ulx_init.lua
///////////////////////////////
//       ULX Admin Mod       //
///////////////////////////////
// Loading...                //
//  sh_defines.lua           //
//  lib.lua                  //
//  base.lua                 //
//  sh_base.lua              //
//  log.lua                  //
//  MODULE: slots.lua        //
//  MODULE: uteam.lua        //
//  MODULE: votemap.lua      //
//  MODULE: xgui_server.lua  //
///////////////////////////////
// ULX GUI -- by Stickly Man //
///////////////////////////////
// Adding Main Modules..     //
//  addons.lua               //
//  bans.lua                 //
//  commands.lua             //
//  groups.lua               //
//  maps.lua                 //
//  settings.lua             //
// Adding Setting Modules..  //
//  client.lua               //
//  server.lua               //
// Adding Gamemode Modules.. //
//  sandbox.lua              //
//  terrortown.lua           //
// Loading Server Modules..  //
//  sv_bans.lua              //
//  sv_groups.lua            //
//  sv_maps.lua              //
//  sv_sandbox.lua           //
//  sv_settings.lua          //
//  sv_terrortown.lua        //
// XGUI modules added!       //
///////////////////////////////
//  MODULE: cc_chat.lua      //
//  MODULE: cc_commandtable.lua//
HTTP failed - ISteamHTTP isn't available!
HTTP failed - ISteamHTTP isn't available!
//  MODULE: cc_cvars.lua     //
//  MODULE: cc_effects.lua   //
//  MODULE: cc_extras.lua    //
//  MODULE: cc_fun.lua       //
//  MODULE: cc_hook.lua      //
//  MODULE: cc_menus.lua     //
//  MODULE: cc_notepad.lua   //
//  MODULE: cc_pgag.lua      //
//  MODULE: cc_rcon.lua      //
//  MODULE: cc_soundlist.lua //
//  MODULE: cc_teleport.lua  //
//  MODULE: cc_util.lua      //
//  MODULE: cc_voting.lua    //
//  MODULE: chat.lua         //
//  MODULE: fun.lua          //
//  MODULE: mapvote.lua      //
//  MODULE: menus.lua        //
//  MODULE: rcon.lua         //
//  MODULE: teleport.lua     //
//  MODULE: ttt2rolesinfo.lua//
//  MODULE: ttt_admin.lua    //
//  MODULE: ttt_fun.lua      //
//  MODULE: ttt_shopeditor.lua//
//  MODULE: ttt_voting.lua   //
//  MODULE: user.lua         //
//  MODULE: userhelp.lua     //
//  MODULE: util.lua         //
//  MODULE: vote.lua         //
//  end.lua                  //
// Load Complete!            //
///////////////////////////////
-- Hit Numbers loaded --
Included TTT language file: terrortown/gamemode/shared/lang/chef.lua
Included TTT language file: terrortown/gamemode/shared/lang/english.lua
Included TTT language file: terrortown/gamemode/shared/lang/german.lua
Included TTT language file: terrortown/gamemode/shared/lang/italian.lua
Included TTT language file: terrortown/gamemode/shared/lang/polish.lua
Included TTT language file: terrortown/gamemode/shared/lang/russian.lua
[TTT2][Huds] Registered abstract HUD hud_base
[TTT2][Huds] Registered abstract HUD scalable_hud
[TTT2][Huds] Registered HUD old_ttt
[TTT2][Huds] Registered HUD pure_skin
[TTT2][HUDManager] Loading data from database...
[TTT2][ROLE] Setting up 'detective' role...
[TTT2][ROLE] Setting up 'innocent' role...
[TTT2][ROLE] Setting up 'traitor' role...
HTTP failed - ISteamHTTP isn't available!
Trouble In Terrorist Town 2 gamemode initializing...
This is [TTT2] Trouble in Terrorist Town 2 (Advanced Update) - by Alf21 (v0.6.4b)
[TTT2][ROLE] Adding 'traitor' role...
[TTT2][ROLE] Added 'traitor' role (index: 1)
[TTT2][ROLE] Adding 'detective' role...
[TTT2][ROLE] Added 'detective' role (index: 2)
[TTT2][ROLE] Adding 'innocent' role...
[TTT2][ROLE] Added 'innocent' role (index: 0)
TTT2 WARNING: sv_alltalk is enabled. Dead players will be able to talk to living players. TTT2 will now attempt to set sv_alltalk 0.
Making workshop map available for client download
Unknown command "cl_new_impact_effects"
Executing dedicated server config file server.cfg
Using map cycle file cfg/mapcycle.txt.
Trying to precache breakable prop, but has no model name
Trying to precache breakable prop, but has no model name
Error! Flag "$model" is multiply defined in material "models/sgg/starwars/weapons/luke_saber/saber2"!
Error! Flag "$model" is multiply defined in material "models/sgg/starwars/weapons/luke_saber/saber"!
Error! Flag "$model" is multiply defined in material "models/sgg/starwars/weapons/luke_saber/saber3"!
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/sgg/starwars/weapons/luke_saber/glow.vmt
Unlittwotexture, (*proxies*), (*TextureScroll*),
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/sgg/starwars/weapons/luke_saber/glow.vmt
Unlittwotexture, (*proxies*), (*TextureScroll*),
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/sgg/starwars/weapons/obiwan_ep1_saber/glow.vmt
Unlittwotexture, (*proxies*), (*TextureScroll*),
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file materials/models/sgg/starwars/weapons/obiwan_ep1_saber/glow.vmt
Unlittwotexture, (*proxies*), (*TextureScroll*),
Error! Flag "$model" is multiply defined in material "models/sgg/starwars/weapons/obiwan_ep1_saber/saber1"!
Error! Flag "$model" is multiply defined in material "models/sgg/starwars/weapons/obiwan_ep1_saber/saber"!
TTT2 initializing ConVar settings...
[TTT2][INFO] Client post-init...
[TTT2][INFO] Shops initialized...
Failed to load .nav file: Cannot access!
Initializing Steam libraries for LAN server
Logging into Steam game server account
Unknown command "roundalert_sound"
Unknown command "ttt_sm_duration"
Unknown command "entinfo_enabled"
Assigned persistent gameserver Steam ID [G-1:3244267].
VAC secure mode disabled.
Client "Breakthrough" connected (192.168.141.1:27005).
Crazy origin on entity [38][prop_physics_multiplayer]
        Origin:           [1745.614868, 1829.970459, -16397.582031]
        Angles:           [23.078897, -36.143589, 21.866859]
        Velocity:         [0.021647, 1.804928, -1717.432007]
        Angular Velocity: [-38.371937, 1.251151, -65.729691]
Defusing!
Removing!
[TTT2][HUDManager] Player Breakthrough requested full state update...
Breakthrough: I am in!
S3: Duplicate client connection: UserID: 3 SteamID 3719543
S3: Duplicate client connection: UserID: 3 SteamID 3719543
Client "(1)Breakthrough" connected (192.168.141.1:27006).
[TTT2][HUDManager] Player (1)Breakthrough requested full state update...
Crazy origin on entity [13][prop_physics_multiplayer]
        Origin:           [1745.614868, 1829.970459, -16397.582031]
        Angles:           [23.078897, -36.143589, 21.866859]
        Velocity:         [0.021647, 1.804928, -1717.432007]
        Angular Velocity: [-38.371937, 1.251151, -65.729691]
Defusing!
Removing!
(1)Breakthrough: I am also in!
(1)Breakthrough: Round is "Preparing"

[TTT2] gamemodes/terrortown/gamemode/server/sv_main.lua:1861: table index is nil
  1. SelectRoles - gamemodes/terrortown/gamemode/server/sv_main.lua:1861
   2. unknown - gamemodes/terrortown/gamemode/server/sv_main.lua:1132

Timer Failed! [prep2begin][@gamemodes/terrortown/gamemode/server/sv_main.lua (line 923)]
lua_run print(type(Entity(1):SteamID64()))
> print(type(Entity(1):SteamID64()))...
string
lua_run print(type(Entity(2):SteamID64()))
> print(type(Entity(2):SteamID64()))...
no value
Histalek commented 4 years ago

https://support.steampowered.com/kb_article.php?ref=8963-EIKC-3767#simultaneous https://support.steampowered.com/kb_article.php?ref=8963-EIKC-3767#dedicated

This is not a problem with TTT2 as this is clearly not supported by Steam.

Alf21 commented 4 years ago

To clarify a bit: We can't do anything here. There are two solution that gonna work if replacing SteamID64: https://wiki.facepunch.com/gmod/Player:UniqueID (highly recommended not using it) and https://wiki.facepunch.com/gmod/Entity:EntIndex (which gonna lead to problems because of reusing indexes that needs to get cleared or cached,...).

As result, this is not recommended. It should be handled by Steam. Sorry :/