9 Commits

Author SHA1 Message Date
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
Kawe Mazidjatari
0b49ea1f29 Use 'g_pServer->IsActive()' over 'g_pHostState->m_bActiveGame' 2022-08-28 17:40:03 +02:00
Kawe Mazidjatari
532b4125d5 More thread safety improvements
* Run 'CHostState::Think()' in the main thread.
* Construct 'NetGameServer_t' objects in main thread before dispatching (TODO: browser).
* Dispatch the call to 'CBanSystem::AddConnectionRefuse' from 'SV_IsClientBanned' to the main thread if we aren't main.
* Return bool for CBanSystem::AddEntry and CBanSystem::DeleteEntry for future optimizations (next commit).
2022-08-27 23:45:58 +02:00
Kawe Mazidjatari
656b0be3ec Improve threading (work in progress)
* Only run '_DownloadPlaylists_f()' in the main thread, schedule for next frame if we aren't in the main thread. (this should fix crash cases related to disconnecting from the game).

* Locked read/write to CBrowser members (thread for obtaining the server list is detached, but once the 'slow' post operation in this thread is complete, mutex lock is acquired (locking the render thread if the browser is active) to set the string members of CBrowser, this operation is very fast as we only set the string and the color after the http post operation (this never caused a crash, but the behavior without any lock mechanism is technically undefined regardless).

* Obtain the host name dynamically from the ConVar 'pylon_matchmaking_hostname' (atomic operation). Initial approach was deleting the whole master server pointer just to construct a new httpclient object..
2022-08-27 18:57:56 +02:00
Kawe Mazidjatari
28d1463c9f 'CServerListManager::LaunchServer()' improvements
Changelevel instead when we have an active game (Script_ShutdownHostGame() no longer needs to be called beforehands).
2022-08-22 01:56:20 +02:00
Marvin D
eeec292238 Don't need to run CBuf_Execute. Game does it itself.
* How did I forget to remember that for almost a year..
* Connect and disconnect commands also fixed now.
2022-08-19 22:25:26 +02:00
Kawe Mazidjatari
6764b5e56e Implement frame tasks
Run all Cbuf_Execute calls in the main thread. This should fix every problem related to (but not only):
* Connecting to server while RUI dialogue is still open.
* Connecting to server while in an active game.
* Running 'weapon_reparse'.
2022-08-19 21:33:31 +02:00
Kawe Mazidjatari
ad28dcf7fd Remove print 2022-08-14 15:44:37 +02:00
Kawe Mazidjatari
bf3b7bdace Server browser cleanup
* Moved server utility to dedicated class shared by browser panel and UI script VM.
* Additional code improvements and optimizations.
2022-08-14 15:43:49 +02:00