Skip to content

Commit

Permalink
Miscellaneous improvements
Browse files Browse the repository at this point in the history
- Add more colors to indicate the time difference with a ghost kart, with new thresholds at +- 0.3s and +-2.5s, while keeping noticeable contrast between colors
- Confirm in the networking documentation that STK's networking uses UDP
  • Loading branch information
Alayan-stk-2 committed Dec 23, 2024
1 parent 4a479ed commit c73a797
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions NETWORKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ The current server configuration xml looks like this:
```

At the moment STK has a list of STUN servers for NAT penetration which allows players or servers behind a firewall or router to be able to connect to each other, but in case it doesn't work, you have to manually disable the firewall or port forward the port(s) used by STK.
By default STK servers use port `2759`. For example, in Ubuntu based distributions, run the following command to disable the firewall on that port:
By default STK servers use port `2759` (UDP). For example, in Ubuntu based distributions, run the following command to disable the firewall on that port:

`sudo ufw allow 2759`

You may also need to handle the server discovery port `2757` for connecting your WAN server in LAN / localhost.
You may also need to handle the server discovery port `2757` (UDP) for connecting your WAN server in LAN / localhost.

Notice: You don't need to make any firewall or router configuration changes if you connect to the recommended servers (marked with ☆★STK★☆).

Expand Down
16 changes: 12 additions & 4 deletions src/states_screens/race_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,22 @@ void RaceGUI::drawLiveDifference()
video::SColor time_color;

// Change color depending on value
if (live_difference > 1.0f)
if (live_difference > 2.5f)
time_color = video::SColor(255, 255, 0, 0);
else if (live_difference > 1.0f)
time_color = video::SColor(255, 255, 60, 0);
else if (live_difference > 0.3f)
time_color = video::SColor(255, 255, 120, 0);
else if (live_difference > 0.0f)
time_color = video::SColor(255, 255, 160, 0);
time_color = video::SColor(255, 255, 180, 0);
else if (live_difference > -0.3f)
time_color = video::SColor(255, 210, 230, 0);
else if (live_difference > -1.0f)
time_color = video::SColor(255, 160, 255, 0);
time_color = video::SColor(255, 105, 255, 0);
else if (live_difference > -2.5f)
time_color = video::SColor(255, 0, 210, 30);
else
time_color = video::SColor(255, 0, 255, 0);
time_color = video::SColor(255, 0, 160, 60);

int dist_from_right = 10 + timer_width;

Expand Down

0 comments on commit c73a797

Please sign in to comment.