Commit Graph

18753 Commits

Author SHA1 Message Date
Benau
6c18664967 Make sure protocol manager exists when requesting 2018-02-25 15:24:46 +08:00
Benau
c5cf87071c Use xmlEncode for proper unicode handling 2018-02-25 14:32:38 +08:00
Benau
2fcaeabf1c Increase timeout in case of busy network 2018-02-25 13:45:43 +08:00
Benau
571a524f59 Update lobby for new gui engine code 2018-02-25 13:31:45 +08:00
auria.mg
7b903a09ba Add text_valign="top" support to GUI engine 2018-02-24 21:49:49 -05:00
auria.mg
8d565fba11 Unicode fix 2018-02-24 21:38:31 -05:00
Benau
34caab24fe Update networking lobbdy for better display info 2018-02-25 02:09:07 +08:00
Benau
2a117d8e44 Don't lock in async update in protocol manager
It allows GUI interacts with protocol more actively

Also don't handle lan connection request if we are not waiting for
players
2018-02-25 02:07:24 +08:00
Benau
b26b784b6a Various improvements to WAN and LAN connection 2018-02-24 15:48:30 +08:00
Ethan Uzarowski
b782af2949 Remove "Final lap!" message in one-lap races (#3127)
* Fix "Final lap!" message on one-lap races

When starting a one-lap race, the game gives the message "Final lap!". This should only be given when there is more than one lap in the race. This commit changes linear_world.cpp so that this message is only given when the number of laps in the race is greater than 1.

* Fix spacing

I accidentally changed the spacing when making my last commit. This commit fixes that accident.
2018-02-23 20:43:46 -05:00
hiker
95f0bf9e3b Used functions in stk_config to convert between ticks and times. 2018-02-23 23:22:49 +11:00
Benau
d586ab9011 Allow auto-fallback to another unused port if needed 2018-02-23 16:16:43 +08:00
Benau
a93182740e Reset NetworkConfig when exiting WAN game screen 2018-02-23 15:46:03 +08:00
Benau
7d14954012 Simpify network console 2018-02-23 14:57:59 +08:00
Benau
1023e6580e Unregister STK server when exiting 2018-02-23 14:01:20 +08:00
hiker
cb712411e0 Converte some pararchute values to use ticks. 2018-02-23 10:01:22 +11:00
Benau
005454ba7b Use the recieved port to connect, also fix a possible crash 2018-02-22 16:38:53 +08:00
hiker
81342ddd00 Fixed several mixups of ticks and time. 2018-02-22 19:25:11 +11:00
hiker
7a53cf16fe Fixed compiler warnings. 2018-02-22 19:19:04 +11:00
Benau
33435de026 Fix lan game in localhost, also improve timer behaviour 2018-02-22 16:03:54 +08:00
Benau
4559fd6a2c Remove unused protocol 2018-02-22 15:14:15 +08:00
Benau
1458f3ef8e Fix wan connection, move get public address from stun to stk host 2018-02-22 15:11:07 +08:00
hiker
797e35c674 Bugfix, forgot to change the type from float to int. 2018-02-22 09:23:45 +11:00
hiker
1c3da88e77 Replaced more time with ticks. 2018-02-22 09:22:57 +11:00
hiker
09e7a5cc13 Converted more times to using ticks; fixed bug that in case of
a race restart the fastest lap was not reset.
2018-02-21 22:46:35 +11:00
hiker
27b5409487 Use ticks (at the physics frame rate) for time measurement, which
avoids potential floating point errors (in networking).
2018-02-21 22:18:45 +11:00
hiker
208c5eb6d8 Merge remote-tracking branch 'origin/master' into fix-timestep 2018-02-21 08:35:58 +11:00
Benau
8daebe06e1 Allow creating wan server in command line
It can only be used with a saved online player, also fix a weird
crash if server failed to create (wan is NULL)
2018-02-20 15:11:58 +08:00
Benau
22c755a328 Show protocol name when it is terminated (easier for debugging) 2018-02-20 13:33:43 +08:00
Benau
14b401b54e Use std atomic for server state 2018-02-20 11:14:57 +08:00
Benau
04a6f6d08b Warn user about multiple instance of STK server 2018-02-20 10:11:09 +08:00
Benau
3223d05c6c Merge remote-tracking branch 'origin/master' into network_improvements 2018-02-20 00:14:29 +08:00
Benau
4ab823cfbc Move lan network socket to thread main loop, fixed leaking of it too
Also call enet_deinitialize when destroy STKHost
2018-02-19 11:36:32 +08:00
Benau
e393e3d4f0 With shared_ptr protocol is not leakable 2018-02-18 14:50:06 +08:00
Benau
e52ab5888c Don't crash when close STK window directly 2018-02-18 14:13:24 +08:00
Benau
c5b986e874 Allow going back to online menu if server connection is lost 2018-02-18 14:06:17 +08:00
Benau
6fd7fb0e0e Allow reconnecting to lan servers as many time as possible 2018-02-18 13:24:29 +08:00
Benau
0a5c1a69c7 Use shared_ptr for protocol to avoid leaking
With weak_ptr it's also possible to auto clear LobbyProtocol when
STKHost is shutdown
2018-02-18 12:39:05 +08:00
Benau
bcf8e4e5fe Allow shutdown STKHost from dialog 2018-02-17 16:25:53 +08:00
Benau
4c1cc50955 Don't pause timer in network as it breaks rewind
Also remove the unneed protocol manager checking
2018-02-17 15:38:56 +08:00
Benau
372753f505 Use atomic flag to start / stop listening thread 2018-02-17 11:40:48 +08:00
Benau
cfeadf335c Move some code to header 2018-02-17 10:51:33 +08:00
Benau
c5788a2c90 Move the cleaning of events to destructor of protocol manager
So that the last one who deletes it can clear all the remaining data
properly (ie if it's STKHost listening thread)

Remove the assert in async update thread as it may not be true for
the first thread creation
2018-02-16 00:48:27 +08:00
Benau
05f7c014dd Create a prototype for thread-safe protocol manager
Using weak and shared_ptr, if !lock(), than it was atomtically
destroyed
2018-02-15 16:47:04 +08:00
Benau
3d8efcdfa1 Use >= for counter in case of some peer disconnect in between for completing race end 2018-02-15 15:33:18 +08:00
Benau
fa2a8bccd3 Reset available karts and tracks each selection 2018-02-15 14:07:58 +08:00
Benau
20a2bc3bbb Terminate controller and game event protocols when exit result screen 2018-02-15 13:28:28 +08:00
Benau
e7d3658a53 Merge remote-tracking branch 'origin/network_improvements' into game_protocol 2018-02-15 10:36:14 +08:00
hiker
c0333fe0f7 Bugfix: TimeInfo objects were missing for substeps, resulting in
very stuttering game play.
2018-02-15 10:06:13 +11:00
Deve
bfb862645d Print some debug info 2018-02-14 22:28:55 +01:00