Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce8eba8088 | ||
|
|
62dee62eb6 | ||
|
|
cf11cc86ce | ||
|
|
40e4ff2cf8 | ||
|
|
e901c92b41 | ||
|
|
dc52b7a592 | ||
|
|
93b67eb7d7 | ||
|
|
38ccb5f9a4 | ||
|
|
54de4909ef | ||
|
|
1797ecd9ef | ||
|
|
eb16cf4bdc | ||
|
|
52c1934dab | ||
|
|
bc37efd5da | ||
|
|
f9bfca84b0 | ||
|
|
453c24e6e0 | ||
|
|
b1d71f070f | ||
|
|
90ab2ff094 | ||
|
|
8488a161eb | ||
|
|
4c624fcbed | ||
|
|
8652d565da | ||
|
|
bc2344fb44 | ||
|
|
7abd376b85 | ||
|
|
e6d1e09bd7 | ||
|
|
e94255072e | ||
|
|
c527105b31 | ||
|
|
da38822634 | ||
|
|
90dd65cab4 | ||
|
|
efabb0d056 | ||
|
|
4ac609f0df | ||
|
|
be521e2621 | ||
|
|
75b2393ccf | ||
|
|
8592780212 | ||
|
|
861b8faca7 | ||
|
|
f9676b2962 | ||
|
|
0ca693e681 | ||
|
|
9fc9f4e7a4 | ||
|
|
8a899e7650 | ||
|
|
8413225a55 | ||
|
|
0792a3aecb | ||
|
|
3efe79a38d | ||
|
|
e393fbe716 | ||
|
|
5530d19769 |
No files matched your search
@@ -469,6 +469,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
concurrency:
|
||||
@@ -483,6 +484,45 @@ jobs:
|
||||
name: halo-web-release
|
||||
path: site
|
||||
|
||||
# The game's wasm, most of a build, from jsDelivr rather than GitHub
|
||||
# Pages, which serves 100 GB a month: the wasm alone in a commit of the
|
||||
# web-wasm branch (pushed over the last, so the repository keeps one),
|
||||
# which jsDelivr serves by its hash (with CORS; GitHub's release
|
||||
# downloads have none, so a page cannot fetch them), and version.json
|
||||
# names that copy and its SHA-256. The site's service worker takes the
|
||||
# wasm from there, checked, and from the site only when it cannot
|
||||
# (port/web/site/sw.js). A failure here leaves the site serving it.
|
||||
- name: The wasm on jsDelivr
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
sha256="$(sha256sum site/halo.wasm | cut -d' ' -f1)"
|
||||
mkdir wasm
|
||||
cp site/halo.wasm wasm/
|
||||
cd wasm
|
||||
git init -q -b web-wasm
|
||||
git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
|
||||
add halo.wasm
|
||||
git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
|
||||
commit -q -m "The web build's wasm (build $GITHUB_RUN_NUMBER, $GITHUB_SHA)"
|
||||
git push -q --force "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:refs/heads/web-wasm
|
||||
url="https://cdn.jsdelivr.net/gh/${GITHUB_REPOSITORY}@$(git rev-parse HEAD)/halo.wasm"
|
||||
# (jsDelivr fetches it now, and it must be the same file: it serves
|
||||
# files of at most 20 MB from GitHub)
|
||||
curl -fsSL --retry 6 --retry-delay 10 --retry-all-errors -o served.wasm "$url"
|
||||
echo "$sha256 served.wasm" | sha256sum -c -
|
||||
cd ..
|
||||
python3 - "$url" "$sha256" <<'EOF'
|
||||
import json, sys
|
||||
with open("site/version.json") as file:
|
||||
stamp = json.load(file)
|
||||
stamp["wasm"] = {"url": sys.argv[1], "sha256": sys.argv[2]}
|
||||
with open("site/version.json", "w") as file:
|
||||
json.dump(stamp, file, indent=1)
|
||||
EOF
|
||||
echo "the wasm from $url"
|
||||
|
||||
- uses: actions/configure-pages@v5
|
||||
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
|
||||
@@ -16,7 +16,7 @@ end.
|
||||
| --- | --- |
|
||||
| `source/` | The game: 466 C files of the decompilation, compiled as they are with few changes (each marked, below) |
|
||||
| `port/linux/src/` | The platform layer the three ports share: Direct3D 8 on OpenGL (`d3d8_gl.c`), DirectSound and XInput on SDL3, files, threads, memory, sockets, settings (`port_config.c`), the mods folder (`port_mods.c`), internet play (`p2p*.c`) |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), touch, FOV and more |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), streamer mode's word filter (`text_filter*.c`), touch, FOV and more |
|
||||
| `port/linux/include/` | The port's headers: the limits (`halo_port_limits.h`, with `HALO_PORT_NETWORK_VERSION`), capacities (`halo_port_capacity.h`), the prefix header, `halo_linux_source_fixups.h` (port functions the game's sources call) |
|
||||
| `port/include/xdk/` | Stand-ins for the Xbox SDK's headers (declarations only) |
|
||||
| `port/windows/` | The Windows build's own files (`win32_*.c`, headers) |
|
||||
@@ -218,6 +218,7 @@ as documentation of file formats, never copied.
|
||||
| [port/include/xdk/README.md](port/include/xdk/README.md) | How the SDK declarations were written and are checked |
|
||||
| [docs/custom_edition_caches.md](docs/custom_edition_caches.md) | Loading and converting Custom Edition maps, and the evidence for each layout |
|
||||
| [docs/mods.md](docs/mods.md) | Mods: folders of Halo PC tag files whose sounds, bitmaps, text and models play over a map's on one machine |
|
||||
| [port/assets/text_filter/README.md](port/assets/text_filter/README.md) | Streamer mode's words: Surge AI's list, the review, the allowed words |
|
||||
| [port/assets/menus/README.md](port/assets/menus/README.md) | The menu files' format and how to write them again |
|
||||
| [port/assets/menus/NON_HANDDRAWN.md](port/assets/menus/NON_HANDDRAWN.md) | Menu pictures that are not redraws |
|
||||
| [port/assets/menus/UNWIRED.md](port/assets/menus/UNWIRED.md) | Menu functions that do nothing yet |
|
||||
|
||||
@@ -161,7 +161,7 @@ controller for player 1. With the default buttons of the profile:
|
||||
| Crouch, Zoom | left and right stick clicks |
|
||||
| Light, Gren. type | white, black |
|
||||
| Pause, Back | start, back |
|
||||
| Up, Down, Left, Right | D-pad |
|
||||
| Up, Down, Left, Right | D-pad (in a network game, Up opens the text chat's keyboard) |
|
||||
|
||||
The names on the buttons follow the profile's "Button layout" (Settings >
|
||||
Gamepads): with "Swap triggers", the right trigger's button says "Grenade".
|
||||
|
||||
@@ -21,10 +21,11 @@ named where code is taken over.
|
||||
| Aiming | The weapon in the hand, its shots from the muzzle, laser and crosshair options; each weapon held so that its model's hand lands on the real one, as the free hand's (it learns where each weapon's animations hold the hand; the pistol's had been 15 cm before the real hand, the assault rifle's 8 cm aside), the scope's disc moved with it; `vr.weapon_hand_*` to adjust (2026-10-17) |
|
||||
| Body | Physical crouch (`vr.crouch_limit`) beside the crouch button, leaning (`vr.lean_limit`), melee by swinging, grenades thrown with the left hand, two-handed weapons |
|
||||
| Vehicles | The Warthog's wheel turned with the hands, right trigger throttle, left brake; first-person seats; turrets with handles |
|
||||
| Scores | The menu button held shows the scores on the Quest (a press pauses, as it is let go); the Steam Frame's View button as before; the text chat's lines where the desktop has them (2026-10-18) |
|
||||
| Comfort | Snap or smooth turning, a comfort vignette in vehicles, VR options in the main and pause menus (Y), a page of every controller button |
|
||||
| Menus | The PC version's menus in VR (`vr.menus`), clicked with a laser; text typed on the on-screen keyboard |
|
||||
| Multiplayer | Up to date with OpenCE (network version 29, 2026-10-14): cross-play, its server browser, co-op campaign, password lobbies; join codes and the VR online list |
|
||||
| Bots | Bots in multiplayer: on foot (paths, items, objectives), in vehicles and at turrets; they make room for a joining person |
|
||||
| Bots | Bots in multiplayer: on foot (paths, items, objectives), in vehicles and at turrets; they make room for a joining person, on the LAN too (a lobby they fill is advertised open, 2026-10-18) |
|
||||
| Voice chat | Push to talk on any button (`vr.button_talk`, BUTTONS page; the free hand's grip by default, sending nothing while it reaches for the foregrip or the wheel), open mic, off (2026-10-13) |
|
||||
| Builds | The Android build's assembly conversion (`tools/android_asm_convert.py`) keeps string data as it is: strings and tables starting with "_" or holding \" lost a "_" (Opus's pulse cache among them: the Steam Frame's crashes in online games while talking), 2026-10-13 |
|
||||
| Languages | The European disc in Spanish and Italian (a maps folder for each, `maps_es` and `maps_it`, none called `maps`) imported on the Quest and the Steam Frame: the headset's language's, its language the game's and the menus' (`maps/language.txt`, unless `game.language` is set), 2026-10-17; not yet tried with that disc |
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
<string text="Anyone can see and join your game: it is listed\nin everyone's Server Browser."/>
|
||||
<string text="Only players with your invite link can join."/>
|
||||
<string text="Friendly fire, the enemies and player collisions,\nfor this game."/>
|
||||
<string text="Voice chat and votes to kick a player, for this\ngame."/>
|
||||
<string text="Voice chat, text chat and votes to kick a player,\nfor this game."/>
|
||||
<string text="Players from the Server Browser must type it to\njoin (an invite link needs none). Enter sets it."/>
|
||||
<string text="Sending players who join without the game's\nCustom Edition map the map, and how fast."/>
|
||||
</strings>
|
||||
@@ -369,6 +369,7 @@
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/op_voice_kbps" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/op_voice_proximity" x="54" y="163"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/op_votekick" x="54" y="193"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/op_text_chat" x="54" y="223"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -458,12 +459,27 @@
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/op_text_chat" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/text_chat_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/text_chat_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/text_chat_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/text_chat_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/voice_options/var_text_chat" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/voice_options/var_text_chat">
|
||||
<string text="ON"/>
|
||||
<string text="WITH LINKS"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_labels">
|
||||
<string text="VOICE CHAT:"/>
|
||||
<string text="LOBBY VOICE CHAT:"/>
|
||||
<string text="VOICE QUALITY:"/>
|
||||
<string text="VOICE NEAR DISTANCE:"/>
|
||||
<string text="VOTE KICK:"/>
|
||||
<string text="TEXT CHAT:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/voice_options/cap_voice_options">
|
||||
<string text="No voice chat during the game."/>
|
||||
@@ -488,6 +504,9 @@
|
||||
<string text="Players 150 metres apart or less are near\nfor voice chat."/>
|
||||
<string text="Players can vote to kick a player, from the\nscoreboard."/>
|
||||
<string text="Players cannot vote to kick anyone."/>
|
||||
<string text="Players can type to each other; lines with links\nare refused. Off in a public internet game."/>
|
||||
<string text="Players can type to each other, links too. Off\nin a public internet game."/>
|
||||
<string text="No text chat in the game."/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/map_share_options/map_share_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/map_share_options/header_map_share_options"/>
|
||||
@@ -543,6 +562,8 @@
|
||||
<string text="2 MB/S"/>
|
||||
<string text="4 MB/S"/>
|
||||
<string text="8 MB/S"/>
|
||||
<string text="16 MB/S"/>
|
||||
<string text="20 MB/S"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/map_share_options/map_share_options_labels">
|
||||
<string text="SHARE MAPS:"/>
|
||||
@@ -557,5 +578,7 @@
|
||||
<string text="The most you send of maps, so that the game\nkeeps the rest of your upload."/>
|
||||
<string text="The most you send of maps, so that the game\nkeeps the rest of your upload."/>
|
||||
<string text="The most you send of maps, so that the game\nkeeps the rest of your upload."/>
|
||||
<string text="The most you send of maps, so that the game\nkeeps the rest of your upload."/>
|
||||
<string text="The most you send of maps, so that the game\nkeeps the rest of your upload."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -78,4 +78,18 @@
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/op_text_chat" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/text_chat_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/text_chat_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/text_chat_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/teamplay_options_labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/text_chat_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/var_text_chat" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/var_text_chat">
|
||||
<string text="ON"/>
|
||||
<string text="WITH LINKS"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -53,6 +53,7 @@
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/op_voice_kbps" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/op_voice_proximity" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/op_votekick" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/op_text_chat" x="54" y="313"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/teamplay_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/teamplay_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/controls_setup/group_label" type="text" controller="1" width="200" height="22" text="SHOW:" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/controls_setup/group_spinner" type="spinner" left="3" top="2" width="297" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="MOVEMENT|WEAPONS|ACTIONS" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 300 19 306">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/controls_setup/group_spinner" type="spinner" left="3" top="2" width="297" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="MOVEMENT|WEAPONS|ACTIONS|COMMUNICATION" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 300 19 306">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/controls_setup/op_command_1" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" run="controls begin binding"/>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's settings screen, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/in_game_network_settings_screen" width="640" height="480" flags="pass_unhandled_to_focused_child pause_game" bitmap="bitmaps/gradient">
|
||||
<on event="b" back="true"/>
|
||||
<on event="back" back="true"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/header_profile_network_settings"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/options_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/header_profile_network_settings" controller="1" left="35" top="11" width="605" height="59" bitmap="main_menu/settings_select/player_setup/player_profile_edit/network_setup/header_profile_network_settings">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/help" type="text" controller="1" left="68" top="350" width="482" height="60" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/help_strings" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/help">
|
||||
<data input="port settings help"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_map_sharing" x="54" y="73" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_multiplayer_hud" x="54" y="103" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_multiplayer_hud" x="54" y="73" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_streamer_mode" x="54" y="133" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_streamer_mode" x="54" y="103" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_defaults" y="1"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_map_sharing" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF" platform="desktop android">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_sharing_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_sharing_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/map_sharing_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/map_sharing_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_multiplayer_hud" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/multiplayer_hud_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/multiplayer_hud_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/multiplayer_hud_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/multiplayer_hud_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/op_streamer_mode" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/streamer_mode_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/streamer_mode_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/streamer_mode_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/streamer_mode_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings save" back="true"/>
|
||||
<on event="start" run="port settings save" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/labels">
|
||||
<string text="MAP SHARING:"/>
|
||||
<string text="MULTIPLAYER HUD:"/>
|
||||
<string text="STREAMER MODE:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/help_strings">
|
||||
<string text=""/>
|
||||
<string text="Downloading Custom Edition maps you do not have,\nand helping send them to other players."/>
|
||||
<string text="Players' names above their heads, the\nscoreboard, and the text chat."/>
|
||||
<string text="Hide offensive words in names and text from\nother players, maps and mods, as stars."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -47,7 +47,7 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_seed_upload_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_seed_upload_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="64 KB/S|128 KB/S|256 KB/S|512 KB/S|1 MB/S|2 MB/S" setting="network.map_seed_upload" values="64|128|256|512|1024|2048" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_seed_upload_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="64 KB/S|128 KB/S|256 KB/S|512 KB/S|1 MB/S|2 MB/S|4 MB/S|8 MB/S|10 MB/S" setting="network.map_seed_upload" values="64|128|256|512|1024|2048|4096|8192|10240" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's settings screen, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/multiplayer_hud_settings_screen" width="640" height="480" flags="pass_unhandled_to_focused_child pause_game" bitmap="bitmaps/gradient">
|
||||
<on event="b" back="true"/>
|
||||
<on event="back" back="true"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/header_profile_network_settings"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/options_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/header_profile_network_settings" controller="1" left="35" top="11" width="605" height="59" bitmap="main_menu/settings_select/player_setup/player_profile_edit/network_setup/header_profile_network_settings">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/help" type="text" controller="1" left="68" top="350" width="482" height="60" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/help_strings" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/help">
|
||||
<data input="port settings help"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_player_names" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_player_name_scale" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_scoreboard_team_layout" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_scoreboard_background" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_text_chat" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_chat_style" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_defaults" y="1"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_player_names" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_names_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_names_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_names_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_names_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ALL|ALLIES|ENEMIES|NONE" setting="display.player_names" values="all|allies|enemies|none" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_player_name_scale" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_name_scale_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_name_scale_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_name_scale_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/player_name_scale_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="0.5x|0.75x|1x|1.25x|1.5x|2x" setting="display.player_name_scale" values="0.5|0.75|1|1.25|1.5|2" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_scoreboard_team_layout" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_team_layout_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_team_layout_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_team_layout_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_team_layout_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="TEAMS|BY SCORE" setting="display.scoreboard_team_layout" values="teams|score" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_scoreboard_background" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_background_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_background_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_background_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/scoreboard_background_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.scoreboard_background" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_text_chat" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/text_chat_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/text_chat_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/text_chat_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/text_chat_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="SHOW|HIDE" setting="display.text_chat" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/op_chat_style" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/chat_style_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/chat_style_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/chat_style_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/chat_style_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="COLORS|WHITE" setting="display.chat_style" values="colors|white" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings save" back="true"/>
|
||||
<on event="start" run="port settings save" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/labels">
|
||||
<string text="PLAYER NAMES:"/>
|
||||
<string text="PLAYER NAME SIZE:"/>
|
||||
<string text="SCOREBOARD LAYOUT:"/>
|
||||
<string text="SCOREBOARD PANEL:"/>
|
||||
<string text="TEXT CHAT:"/>
|
||||
<string text="CHAT TEXT:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/help_strings">
|
||||
<string text=""/>
|
||||
<string text="In multiplayer, whose names are drawn above their\nheads."/>
|
||||
<string text="How large the players' names are drawn."/>
|
||||
<string text="A team game's scoreboard: a column for each team,\nor every player in order of score."/>
|
||||
<string text="Draw a panel behind the scoreboard, for clearer\ntext."/>
|
||||
<string text="SHOW the text chat, or HIDE it: no lines, and\nits keys and D-pad Up open nothing."/>
|
||||
<string text="The text chat's colors: COLORS, names in their\nteam's color; WHITE, as Custom Edition."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's settings screen, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/streamer_mode_settings_screen" width="640" height="480" flags="pass_unhandled_to_focused_child pause_game" bitmap="bitmaps/gradient">
|
||||
<on event="b" back="true"/>
|
||||
<on event="back" back="true"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/header_profile_network_settings"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/options_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/header_profile_network_settings" controller="1" left="35" top="11" width="605" height="59" bitmap="main_menu/settings_select/player_setup/player_profile_edit/network_setup/header_profile_network_settings">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/help" type="text" controller="1" left="68" top="350" width="482" height="60" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/help_strings" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/help">
|
||||
<data input="port settings help"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_enabled" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_slurs" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_swearing" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_insults" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_defaults" y="1"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_enabled" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/enabled_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/enabled_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/enabled_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/enabled_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="streamer.enabled" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_slurs" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/slurs_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/slurs_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/slurs_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/slurs_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="OFF|SEVERE|STRONG AND WORSE|MILD AND WORSE" setting="streamer.slurs" values="off|severe|strong|mild" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_swearing" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/swearing_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/swearing_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/swearing_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/swearing_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="OFF|SEVERE|STRONG AND WORSE|MILD AND WORSE" setting="streamer.swearing" values="off|severe|strong|mild" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/op_insults" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/insults_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/insults_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/insults_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/insults_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="OFF|SEVERE|STRONG AND WORSE|MILD AND WORSE" setting="streamer.insults" values="off|severe|strong|mild" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings save" back="true"/>
|
||||
<on event="start" run="port settings save" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/labels">
|
||||
<string text="STREAMER MODE:"/>
|
||||
<string text="CENSOR SLURS:"/>
|
||||
<string text="CENSOR SWEARING:"/>
|
||||
<string text="CENSOR INSULTS:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/help_strings">
|
||||
<string text=""/>
|
||||
<string text="Hide offensive words in names and text from\nother players, maps and mods, as stars."/>
|
||||
<string text="Slurs about race, sexuality, gender and\ndisability."/>
|
||||
<string text="Swearing and sexual words (STRONG AND WORSE\nleaves the mildest showing)."/>
|
||||
<string text="Name-calling and insults that are not slurs."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -17,15 +17,11 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_allow_upnp" x="54" y="103" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_join_from_clipboard" x="54" y="133" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_auto" x="54" y="163" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_names" x="54" y="193" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_names" x="54" y="103" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_name_scale" x="54" y="223" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_name_scale" x="54" y="133" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_team_layout" x="54" y="253" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_team_layout" x="54" y="163" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_background" x="54" y="283" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_background" x="54" y="193" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_map_sharing" x="54" y="313" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_map_sharing" x="54" y="193" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_multiplayer_hud" x="54" y="223" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_multiplayer_hud" x="54" y="103" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_streamer_mode" x="54" y="253" platform="desktop android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_streamer_mode" x="54" y="133" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -69,49 +65,29 @@
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/auto_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="update.auto" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_names" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_names_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_names_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_names_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_names_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ALL|ALLIES|ENEMIES|NONE" setting="display.player_names" values="all|allies|enemies|none" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_player_name_scale" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_name_scale_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_name_scale_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_name_scale_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/player_name_scale_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="0.5x|0.75x|1x|1.25x|1.5x|2x" setting="display.player_name_scale" values="0.5|0.75|1|1.25|1.5|2" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_team_layout" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_team_layout_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_team_layout_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_team_layout_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_team_layout_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="TEAMS|BY SCORE" setting="display.scoreboard_team_layout" values="teams|score" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_scoreboard_background" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_background_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_background_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_background_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/scoreboard_background_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.scoreboard_background" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_map_sharing" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF" platform="desktop android">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_sharing_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing/map_sharing_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/map_sharing_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_multiplayer_hud" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/multiplayer_hud_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud/multiplayer_hud_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/multiplayer_hud_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/op_streamer_mode" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/streamer_mode_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode/streamer_mode_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/streamer_mode_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/network_setup/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
@@ -128,11 +104,9 @@
|
||||
<string text="UPNP PORT FORWARDING:"/>
|
||||
<string text="JOIN FROM CLIPBOARD:"/>
|
||||
<string text="CHECK FOR UPDATES:"/>
|
||||
<string text="PLAYER NAMES:"/>
|
||||
<string text="PLAYER NAME SIZE:"/>
|
||||
<string text="SCOREBOARD LAYOUT:"/>
|
||||
<string text="SCOREBOARD PANEL:"/>
|
||||
<string text="MAP SHARING:"/>
|
||||
<string text="MULTIPLAYER HUD:"/>
|
||||
<string text="STREAMER MODE:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/network_setup/help_strings">
|
||||
<string text=""/>
|
||||
@@ -140,10 +114,8 @@
|
||||
<string text="Let internet play ask the router to forward its\nport, for networks that stop connections."/>
|
||||
<string text="Join the game of an invite link copied before\nswitching to the game."/>
|
||||
<string text="Look for a new version when the game starts."/>
|
||||
<string text="In multiplayer, whose names are drawn above their\nheads."/>
|
||||
<string text="How large the players' names are drawn."/>
|
||||
<string text="A team game's scoreboard: a column for each team,\nor every player in order of score."/>
|
||||
<string text="Draw a panel behind the scoreboard, for clearer\ntext."/>
|
||||
<string text="Downloading Custom Edition maps you do not have,\nand helping send them to other players."/>
|
||||
<string text="Players' names above their heads, the\nscoreboard, and the text chat."/>
|
||||
<string text="Hide offensive words in names and text from\nother players, maps and mods, as stars."/>
|
||||
</strings>
|
||||
</menus>
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
@@ -1045,6 +1045,9 @@
|
||||
<string text="Players 150 metres apart or less are near\nfor voice chat."/>
|
||||
<string text="Players can vote to kick a player, from the\nscoreboard."/>
|
||||
<string text="Players cannot vote to kick anyone."/>
|
||||
<string text="Players can type to each other; lines with links\nare refused. Off in a public internet game."/>
|
||||
<string text="Players can type to each other, links too. Off\nin a public internet game."/>
|
||||
<string text="No text chat in the game."/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/teamplay_options_labels">
|
||||
<string text="FRIENDLY FIRE:"/>
|
||||
@@ -1055,6 +1058,7 @@
|
||||
<string text="VOICE QUALITY:"/>
|
||||
<string text="VOICE NEAR DISTANCE:"/>
|
||||
<string text="VOTE KICK:"/>
|
||||
<string text="TEXT CHAT:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/teamplay_options_edit/var_friendly_fire">
|
||||
<string text="OFF"/>
|
||||
|
||||
@@ -47,7 +47,10 @@
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.gamepad_setup.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.mouse_settings.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.name_edit.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.in_game.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.map_sharing.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.multiplayer_hud.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.streamer_mode.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.fov_viewmodels.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.graphics.xml",
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="64" viewBox="0 0 256 64">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="64" viewBox="0 0 256 64">
|
||||
<defs>
|
||||
<path id="gD" d="M736 -413Q736 -529 659 -621Q573 -719 396 -719H68V0H400Q486 0 540 -17Q590 -36 657 -90Q689 -118 708 -163Q716 -177 717 -183Q718 -186 720 -194Q722 -199 723 -205Q726 -222 729 -235Q731 -253 731 -263Q733 -271 735 -288Q736 -297 736 -321V-333V-347V-364V-386ZM570 -358V-329V-326Q568 -303 566 -287Q562 -259 559 -245Q558 -240 556 -229Q554 -222 554 -221L537 -182Q510 -140 469 -131L452 -128L434 -126L394 -125H219V-594H394L438 -592L478 -584Q517 -573 540 -531Q558 -497 565 -444Q567 -431 569 -407Q570 -394 570 -369Z"/>
|
||||
<path id="gM" d="M877 0V-719H656L473 -168L291 -719H69V0H224L208 -564L396 0H557L740 -559L728 0Z"/>
|
||||
<path id="gO" d="M742 -307Q742 -373 736 -427Q730 -477 719 -519Q683 -638 591 -688Q510 -733 354 -733Q198 -733 110 -638Q22 -544 22 -361Q22 -174 110 -80Q199 15 381 15Q475 15 542 -9Q610 -33 653 -79Q742 -174 742 -307ZM577 -358Q577 -248 536 -183Q485 -108 425 -108Q363 -108 333 -114L283 -128Q252 -140 231 -167Q213 -195 205 -226Q186 -293 186 -384Q186 -471 228 -534Q279 -609 381 -609Q488 -609 537 -533Q577 -472 577 -358Z"/>
|
||||
<path id="gS" d="M712 -179Q712 -256 702 -297Q692 -340 668 -361L646 -379L629 -392Q607 -405 583 -410L562 -414L538 -417L481 -418Q241 -418 213 -437Q186 -458 186 -502Q186 -546 218 -569Q250 -590 304 -590H677V-719H280Q160 -719 98 -672Q28 -617 28 -487Q28 -357 141 -313Q193 -293 306 -293L355 -294H389Q510 -294 536 -268Q541 -263 544 -255Q549 -248 550 -237Q553 -225 553 -192Q553 -161 516 -142Q491 -129 436 -129H58V0Q581 0 642 -46Q712 -98 712 -179Z"/>
|
||||
<path id="gD" d="M0,0L11.75,0C16.21,0 19.83,3.62 19.83,8.08L19.83,13.42C19.83,17.88 16.21,21.5 11.75,21.5L0,21.5ZM4.76,17.67L10.59,17.67C13.07,17.67 15.08,15.66 15.08,13.18L15.08,8.32C15.08,5.84 13.07,3.83 10.59,3.83L4.76,3.83Z"/>
|
||||
<path id="gM" d="M0,0L6.86,0L12.21,16.25L17.56,0L24.43,0L24.43,21.5L19.96,21.5L19.96,5.76L14.69,21.5L9.73,21.5L4.46,5.76L4.46,21.5L0,21.5Z"/>
|
||||
<path id="gO" d="M0,8.58C0,3.62 4.02,-0.4 8.98,-0.4L12.39,-0.4C17.35,-0.4 21.37,3.62 21.37,8.58L21.37,12.92C21.37,17.88 17.35,21.9 12.39,21.9L8.98,21.9C4.02,21.9 0,17.88 0,12.92ZM5.06,12.7C5.06,15.7 7.5,18.13 10.49,18.13L10.88,18.13C13.88,18.13 16.31,15.7 16.31,12.7L16.31,8.8C16.31,5.8 13.88,3.37 10.88,3.37L10.49,3.37C7.5,3.37 5.06,5.8 5.06,8.8Z"/>
|
||||
<path id="gS" d="M20.26,0L20.26,3.84L7.18,3.84C5.73,3.84 4.55,5.02 4.55,6.47L4.55,6.07C4.55,7.52 5.73,8.7 7.18,8.7L15.05,8.7C17.93,8.7 20.26,11.03 20.26,13.91L20.26,16.29C20.26,19.17 17.93,21.5 15.05,21.5L0,21.5L0,17.66L13.08,17.66C14.53,17.66 15.71,16.48 15.71,15.03L15.71,15.11C15.71,13.65 14.53,12.47 13.08,12.47L5.21,12.47C2.33,12.47 0,10.14 0,7.27L0,5.21C0,2.33 2.33,0 5.21,0Z"/>
|
||||
</defs>
|
||||
<!-- "MODS" (normal state: dim blue) -->
|
||||
<g id="text" fill="#2895ff" stroke="#2895ff" opacity="0.467" stroke-width="33.30" stroke-linejoin="round">
|
||||
<use href="#gM" transform="translate(86.71,26.00) scale(0.02702)"/>
|
||||
<use href="#gO" transform="translate(112.11,26.00) scale(0.02702)"/>
|
||||
<use href="#gD" transform="translate(132.81,26.00) scale(0.02702)"/>
|
||||
<use href="#gS" transform="translate(153.40,26.00) scale(0.02702)"/>
|
||||
<g id="text" fill="#2895ff" fill-opacity="0.467">
|
||||
<use href="#gM" transform="translate(87.45,6.57) scale(0.9037)"/>
|
||||
<use href="#gO" transform="translate(112.40,6.57) scale(0.9037)"/>
|
||||
<use href="#gD" transform="translate(134.24,6.57) scale(0.9037)"/>
|
||||
<use href="#gS" transform="translate(154.24,6.57) scale(0.9037)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -1,24 +1,24 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="64" viewBox="0 0 256 64">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="64" viewBox="0 0 256 64">
|
||||
<defs>
|
||||
<path id="gD" d="M736 -413Q736 -529 659 -621Q573 -719 396 -719H68V0H400Q486 0 540 -17Q590 -36 657 -90Q689 -118 708 -163Q716 -177 717 -183Q718 -186 720 -194Q722 -199 723 -205Q726 -222 729 -235Q731 -253 731 -263Q733 -271 735 -288Q736 -297 736 -321V-333V-347V-364V-386ZM570 -358V-329V-326Q568 -303 566 -287Q562 -259 559 -245Q558 -240 556 -229Q554 -222 554 -221L537 -182Q510 -140 469 -131L452 -128L434 -126L394 -125H219V-594H394L438 -592L478 -584Q517 -573 540 -531Q558 -497 565 -444Q567 -431 569 -407Q570 -394 570 -369Z"/>
|
||||
<path id="gM" d="M877 0V-719H656L473 -168L291 -719H69V0H224L208 -564L396 0H557L740 -559L728 0Z"/>
|
||||
<path id="gO" d="M742 -307Q742 -373 736 -427Q730 -477 719 -519Q683 -638 591 -688Q510 -733 354 -733Q198 -733 110 -638Q22 -544 22 -361Q22 -174 110 -80Q199 15 381 15Q475 15 542 -9Q610 -33 653 -79Q742 -174 742 -307ZM577 -358Q577 -248 536 -183Q485 -108 425 -108Q363 -108 333 -114L283 -128Q252 -140 231 -167Q213 -195 205 -226Q186 -293 186 -384Q186 -471 228 -534Q279 -609 381 -609Q488 -609 537 -533Q577 -472 577 -358Z"/>
|
||||
<path id="gS" d="M712 -179Q712 -256 702 -297Q692 -340 668 -361L646 -379L629 -392Q607 -405 583 -410L562 -414L538 -417L481 -418Q241 -418 213 -437Q186 -458 186 -502Q186 -546 218 -569Q250 -590 304 -590H677V-719H280Q160 -719 98 -672Q28 -617 28 -487Q28 -357 141 -313Q193 -293 306 -293L355 -294H389Q510 -294 536 -268Q541 -263 544 -255Q549 -248 550 -237Q553 -225 553 -192Q553 -161 516 -142Q491 -129 436 -129H58V0Q581 0 642 -46Q712 -98 712 -179Z"/>
|
||||
<path id="gD" d="M0,0L11.75,0C16.21,0 19.83,3.62 19.83,8.08L19.83,13.42C19.83,17.88 16.21,21.5 11.75,21.5L0,21.5ZM4.76,17.67L10.59,17.67C13.07,17.67 15.08,15.66 15.08,13.18L15.08,8.32C15.08,5.84 13.07,3.83 10.59,3.83L4.76,3.83Z"/>
|
||||
<path id="gM" d="M0,0L6.86,0L12.21,16.25L17.56,0L24.43,0L24.43,21.5L19.96,21.5L19.96,5.76L14.69,21.5L9.73,21.5L4.46,5.76L4.46,21.5L0,21.5Z"/>
|
||||
<path id="gO" d="M0,8.58C0,3.62 4.02,-0.4 8.98,-0.4L12.39,-0.4C17.35,-0.4 21.37,3.62 21.37,8.58L21.37,12.92C21.37,17.88 17.35,21.9 12.39,21.9L8.98,21.9C4.02,21.9 0,17.88 0,12.92ZM5.06,12.7C5.06,15.7 7.5,18.13 10.49,18.13L10.88,18.13C13.88,18.13 16.31,15.7 16.31,12.7L16.31,8.8C16.31,5.8 13.88,3.37 10.88,3.37L10.49,3.37C7.5,3.37 5.06,5.8 5.06,8.8Z"/>
|
||||
<path id="gS" d="M20.26,0L20.26,3.84L7.18,3.84C5.73,3.84 4.55,5.02 4.55,6.47L4.55,6.07C4.55,7.52 5.73,8.7 7.18,8.7L15.05,8.7C17.93,8.7 20.26,11.03 20.26,13.91L20.26,16.29C20.26,19.17 17.93,21.5 15.05,21.5L0,21.5L0,17.66L13.08,17.66C14.53,17.66 15.71,16.48 15.71,15.03L15.71,15.11C15.71,13.65 14.53,12.47 13.08,12.47L5.21,12.47C2.33,12.47 0,10.14 0,7.27L0,5.21C0,2.33 2.33,0 5.21,0Z"/>
|
||||
<filter id="glow" filterUnits="userSpaceOnUse" x="0" y="0" width="256" height="64">
|
||||
<feGaussianBlur stdDeviation="2.19"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<!-- "MODS" (highlighted: white with blue glow) -->
|
||||
<g fill="#2895ff" stroke="#2895ff" stroke-width="233.13" stroke-linejoin="round" opacity="0.650" filter="url(#glow)">
|
||||
<use href="#gM" transform="translate(86.71,26.00) scale(0.02702)"/>
|
||||
<use href="#gO" transform="translate(112.11,26.00) scale(0.02702)"/>
|
||||
<use href="#gD" transform="translate(132.81,26.00) scale(0.02702)"/>
|
||||
<use href="#gS" transform="translate(153.40,26.00) scale(0.02702)"/>
|
||||
<g fill="#2895ff" stroke="#2895ff" stroke-width="6.3" stroke-linejoin="round" opacity="0.650" filter="url(#glow)">
|
||||
<use href="#gM" transform="translate(87.45,6.57) scale(0.9037)"/>
|
||||
<use href="#gO" transform="translate(112.40,6.57) scale(0.9037)"/>
|
||||
<use href="#gD" transform="translate(134.24,6.57) scale(0.9037)"/>
|
||||
<use href="#gS" transform="translate(154.24,6.57) scale(0.9037)"/>
|
||||
</g>
|
||||
<g id="text" fill="#fff" stroke="#fff" stroke-width="33.30" stroke-linejoin="round">
|
||||
<use href="#gM" transform="translate(86.71,26.00) scale(0.02702)"/>
|
||||
<use href="#gO" transform="translate(112.11,26.00) scale(0.02702)"/>
|
||||
<use href="#gD" transform="translate(132.81,26.00) scale(0.02702)"/>
|
||||
<use href="#gS" transform="translate(153.40,26.00) scale(0.02702)"/>
|
||||
<g id="text" fill="#fff">
|
||||
<use href="#gM" transform="translate(87.45,6.57) scale(0.9037)"/>
|
||||
<use href="#gO" transform="translate(112.40,6.57) scale(0.9037)"/>
|
||||
<use href="#gD" transform="translate(134.24,6.57) scale(0.9037)"/>
|
||||
<use href="#gS" transform="translate(154.24,6.57) scale(0.9037)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,72 @@
|
||||
# Streamer mode's words
|
||||
|
||||
The words streamer mode hides (Settings > Network Setup > Streamer Mode; the
|
||||
`streamer.*` settings in `port/linux/README.md`). The game builds them in
|
||||
from `port/linux/game/text_filter_terms.inc`, which
|
||||
`tools/text_filter_terms.py` writes from Surge AI's list and these files:
|
||||
|
||||
| File | Contents |
|
||||
| --- | --- |
|
||||
| `review.txt` | The review of every base word of Surge AI's list: kept (its group, severity and where it may be found) or dropped, and the spellings dropped. The words are ROT13'd. |
|
||||
| `allow.txt` | Words never hidden, however a hidden word sits inside them (Scunthorpe), in plain text |
|
||||
| `english.txt` | The words of the English word list (`port/third_party/english-words`) that the list hides, ROT13'd, which `tools/test_text_filter_terms.py` checks |
|
||||
|
||||
`python3 tools/text_filter_terms.py --list` shows the table decoded, and
|
||||
`--check "some text"` shows what the game would hide in a text.
|
||||
|
||||
## Surge AI's list
|
||||
|
||||
The words, their categories and their severities come from Surge AI's
|
||||
profanity list, "The Obscenity List": 1,598 English profanities and their
|
||||
spellings, each with up to three base words, up to three categories and a
|
||||
severity that five raters gave it (Mild, Strong or Severe).
|
||||
|
||||
Upstream: https://github.com/surge-ai/profanity (gone since; the Internet
|
||||
Archive's copy of its page of 1 March 2025 shows an MIT `LICENSE`, whose text
|
||||
it did not keep), copied at https://huggingface.co/datasets/mmathys/profanity
|
||||
(MIT), revision `c2a17bf3ec64d9b6418ead1cb5f7ef26dbdffccb`: `profanity_en.csv`,
|
||||
SHA-256 ca4ff7d713a8e6f6ec2616f489cd09f6fb96b8b3af404a207783be58a91f3ede.
|
||||
|
||||
The CSV is not in the repository: give `tools/text_filter_terms.py --surge`
|
||||
its path to write the table again (and `HALO_SURGE_CSV` its path for the
|
||||
test that checks it).
|
||||
|
||||
The groups are made from its categories (`tools/text_filter_terms.py`'s
|
||||
`GROUPS`), each base word in one, then reviewed (`review.txt`):
|
||||
|
||||
| Group | Surge AI's categories |
|
||||
| --- | --- |
|
||||
| SLURS | racial / ethnic slurs, sexual orientation / gender, mental disability, physical disability, political |
|
||||
| SWEARING | sexual anatomy / sexual acts, bodily fluids / excrement, religious offense |
|
||||
| INSULTS | other / general insult, animal references, physical attributes |
|
||||
|
||||
The review adds words of the project's own that their list has not (`term`
|
||||
lines at its end): sexual words (porn, hentai and the like), words for
|
||||
sexualised minors, hate phrases and harassment ("kill yourself"), each with a
|
||||
severity the default levels hide (slurs from mild, swearing from strong).
|
||||
|
||||
The table is made from their list, so it carries their notice:
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) Surge AI
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
# Streamer mode's allowed words (tools/text_filter_terms.py): words never
|
||||
# hidden, nor any part of them, however a hidden word sits inside them
|
||||
# (Scunthorpe). One a line, lowercase.
|
||||
agapornis
|
||||
assess
|
||||
assesses
|
||||
bereshith
|
||||
brushite
|
||||
chashitsu
|
||||
cushite
|
||||
cushitic
|
||||
elkoshite
|
||||
epornitic
|
||||
epornitically
|
||||
girgashite
|
||||
kaneshite
|
||||
koreishite
|
||||
mackintoshite
|
||||
marshite
|
||||
matsushita
|
||||
metabrushite
|
||||
mishit
|
||||
mishits
|
||||
mishitting
|
||||
niggard
|
||||
nonporness
|
||||
peshito
|
||||
phage
|
||||
phages
|
||||
placuntitis
|
||||
placuntoma
|
||||
poorness
|
||||
poornesses
|
||||
rappist
|
||||
scunthorpe
|
||||
shiitake
|
||||
shiite
|
||||
shiites
|
||||
shiitic
|
||||
shitake
|
||||
shittah
|
||||
shittahs
|
||||
shitterton
|
||||
shittim
|
||||
shittims
|
||||
shittimwood
|
||||
snigger
|
||||
spoorn
|
||||
unniggard
|
||||
unporness
|
||||
washita
|
||||
wiggeries
|
||||
wiggery
|
||||
@@ -0,0 +1,297 @@
|
||||
abacbeabtencuvp
|
||||
abapr
|
||||
abaprf
|
||||
ahqrf
|
||||
arteb
|
||||
artebf
|
||||
artebrf
|
||||
artebvq
|
||||
artebvqf
|
||||
avt
|
||||
avtten
|
||||
avttre
|
||||
avttref
|
||||
avttregbr
|
||||
avttrejrrq
|
||||
avttrel
|
||||
avttreqbz
|
||||
avttrerq
|
||||
avttresvfu
|
||||
avttresvfurf
|
||||
avttretbbfr
|
||||
avttreurnq
|
||||
avttrevfu
|
||||
avttrevfz
|
||||
avttreyvat
|
||||
betnfz
|
||||
betnfzf
|
||||
cbea
|
||||
cbeab
|
||||
cbeabf
|
||||
cbeabpeng
|
||||
cbeabpenpl
|
||||
cbeabtencu
|
||||
cbeabtencubznavn
|
||||
cbeabtencul
|
||||
cbeabtencure
|
||||
cbeabtencuvfg
|
||||
cbeabtencuvp
|
||||
cbeabtencuvpnyyl
|
||||
cbeabtencuvrf
|
||||
cbeabybtvpny
|
||||
cbeaf
|
||||
cbearenfgvp
|
||||
cevpx
|
||||
cevpxf
|
||||
chffl
|
||||
chffvrf
|
||||
crpxre
|
||||
crpxref
|
||||
crqbcuvyr
|
||||
cuvybcbeavfg
|
||||
cvff
|
||||
cvffrf
|
||||
encr
|
||||
encrf
|
||||
encvfg
|
||||
encvfgf
|
||||
ergneq
|
||||
ergneqf
|
||||
ergneqrq
|
||||
erqfxva
|
||||
erqfxvaf
|
||||
fcvp
|
||||
fcvpf
|
||||
fcvt
|
||||
fcvx
|
||||
fcvxf
|
||||
fnzob
|
||||
fnzobf
|
||||
fphz
|
||||
fphzf
|
||||
fphzzl
|
||||
fulybpx
|
||||
fulybpxf
|
||||
fung
|
||||
fuvg
|
||||
fuvgf
|
||||
fuvggl
|
||||
fuvggra
|
||||
fuvggrq
|
||||
fuvggvarff
|
||||
fuvggvat
|
||||
fuvggvre
|
||||
fuvggvrfg
|
||||
fuvggyr
|
||||
fuvgn
|
||||
fuvgrcbxr
|
||||
fuvgure
|
||||
fuvgurnq
|
||||
fuvgurry
|
||||
fvffl
|
||||
fyhg
|
||||
fyhgf
|
||||
fyhggl
|
||||
fynt
|
||||
fyntf
|
||||
gbffre
|
||||
gbffref
|
||||
gheq
|
||||
gheqf
|
||||
gjng
|
||||
gjngf
|
||||
gvg
|
||||
gvgf
|
||||
hacbeabtencuvp
|
||||
jbc
|
||||
jbcf
|
||||
jnax
|
||||
jnaxre
|
||||
jrgonpx
|
||||
jrgonpxf
|
||||
juber
|
||||
juberf
|
||||
jvttre
|
||||
mbbcuvybhf
|
||||
mbbcuvyl
|
||||
mbbcuvyr
|
||||
mbbcuvyrf
|
||||
mbbcuvyvfg
|
||||
mbbcuvyvfz
|
||||
mbbcuvyvgr
|
||||
mbbcuvyvgvp
|
||||
mbbcuvyvn
|
||||
mbbcuvyvnp
|
||||
mbbcuvyvp
|
||||
mbbcuvyvrf
|
||||
nany
|
||||
navyvathf
|
||||
nefr
|
||||
nefrf
|
||||
nefrubyr
|
||||
nff
|
||||
nffrf
|
||||
nffubyr
|
||||
nffubyrf
|
||||
nob
|
||||
nobf
|
||||
obare
|
||||
obaref
|
||||
obbof
|
||||
obyybk
|
||||
obyybkrf
|
||||
obyybkrq
|
||||
obyybkvat
|
||||
obyybpx
|
||||
obyybpxf
|
||||
ohgg
|
||||
ohggf
|
||||
ohttre
|
||||
ohttref
|
||||
ohyyfuvg
|
||||
ohyyfuvgf
|
||||
ohyyfuvggrq
|
||||
ohyyfuvggvat
|
||||
onfgneq
|
||||
onfgneqf
|
||||
onfgnneq
|
||||
orfgvnyvgl
|
||||
ornare
|
||||
ornaref
|
||||
ovgpu
|
||||
ovgpul
|
||||
ovgpurel
|
||||
ovgpurevrf
|
||||
ovgpurf
|
||||
ovgpurq
|
||||
ovgpuvat
|
||||
oybjwbo
|
||||
oybjwbof
|
||||
oynpxl
|
||||
pbba
|
||||
pbbaf
|
||||
pbbyvr
|
||||
pbbyvrf
|
||||
pbpx
|
||||
pbpxf
|
||||
pbpxurnq
|
||||
phaavyvathf
|
||||
phag
|
||||
phagf
|
||||
phpx
|
||||
phz
|
||||
pnjx
|
||||
pnjxl
|
||||
pnjxre
|
||||
pnpn
|
||||
pnpnf
|
||||
pnpx
|
||||
pnpxf
|
||||
puvax
|
||||
puvaxf
|
||||
puvaxl
|
||||
puvpxrafuvg
|
||||
pyvg
|
||||
qbhpur
|
||||
qbhpurf
|
||||
qbyg
|
||||
qbygf
|
||||
qlxr
|
||||
qlxrf
|
||||
qnexl
|
||||
qnexvr
|
||||
qnexvrf
|
||||
qntb
|
||||
qntbf
|
||||
qnza
|
||||
qnzaf
|
||||
qvpx
|
||||
qvpxf
|
||||
qvqqyr
|
||||
qvqqyrf
|
||||
qvyqb
|
||||
qvyqbf
|
||||
shpx
|
||||
shpxf
|
||||
shpxjvg
|
||||
shpxre
|
||||
shpxrq
|
||||
shpxvat
|
||||
shttrq
|
||||
sneg
|
||||
snegf
|
||||
snpx
|
||||
snpxf
|
||||
snt
|
||||
sntbg
|
||||
sntbgf
|
||||
sntbgg
|
||||
sntf
|
||||
snttbg
|
||||
snttbgel
|
||||
snttbgf
|
||||
snttbgl
|
||||
snttbgrq
|
||||
snttbgvat
|
||||
snttl
|
||||
snttvat
|
||||
srpx
|
||||
srpxf
|
||||
sryyngbe
|
||||
sryyngbel
|
||||
sryyngvb
|
||||
sryyngvbf
|
||||
synzre
|
||||
synzref
|
||||
tbbx
|
||||
tbbxf
|
||||
tbjy
|
||||
tbqqnz
|
||||
tbqqnza
|
||||
tbqqnzaf
|
||||
tbqqnzarq
|
||||
tbqqnzavg
|
||||
tbqqnzf
|
||||
tbqqnzzvg
|
||||
tlc
|
||||
tlcf
|
||||
tlcfl
|
||||
ubeal
|
||||
ubefrfuvg
|
||||
ubr
|
||||
ubrf
|
||||
uror
|
||||
uryy
|
||||
uryyf
|
||||
vaprfg
|
||||
vaprfgf
|
||||
vaprfghbhf
|
||||
vaprfghbhfarff
|
||||
vaprfghbhfyl
|
||||
vawha
|
||||
wnc
|
||||
wnpxnff
|
||||
wnpxnffrf
|
||||
wnvyonvg
|
||||
wrex
|
||||
wrexf
|
||||
wvtnobb
|
||||
wvtnobbf
|
||||
xabo
|
||||
xabof
|
||||
xaboore
|
||||
xaboorq
|
||||
xlxr
|
||||
xvxr
|
||||
xvxrf
|
||||
xyna
|
||||
xynaf
|
||||
ybyv
|
||||
zbat
|
||||
zbatbybvq
|
||||
zbatbybvqf
|
||||
zbgureshpxre
|
||||
zhss
|
||||
zhssf
|
||||
znfgheongr
|
||||
znfgheongrf
|
||||
@@ -0,0 +1,326 @@
|
||||
# Streamer mode's review of Surge AI's profanity list (tools/text_filter_terms.py):
|
||||
# every base word of its profanity_en.csv kept (its group, severity and rule;
|
||||
# - for Surge AI's severity and the rule worked out) or dropped. The words are
|
||||
# ROT13'd; tools/text_filter_terms.py --list shows them.
|
||||
#
|
||||
# Dropped: everyday words the list has because they can be offensive in some
|
||||
# uses (the filter has no context), and words for identities or anatomy that
|
||||
# are neither slurs nor swearing. Moved: gendered insults filed under
|
||||
# "sexual orientation / gender" go to SWEARING, homophobic phrases filed under
|
||||
# the sexual categories go to SLURS, and the mild insults filed under "mental
|
||||
# disability" or "sexual orientation / gender" go to INSULTS. Severities
|
||||
# raised or lowered where one spelling's rating set the word's (damn and butt
|
||||
# are mild, as Ofcom rates them; the Australian slur rated mild is strong).
|
||||
|
||||
drop 69
|
||||
keep - - - norrq
|
||||
keep - strong whole nob
|
||||
drop noenunz
|
||||
keep - - whole nany
|
||||
drop nahf
|
||||
drop ncr
|
||||
keep - - - nefr
|
||||
keep - - whole nff
|
||||
keep - - - onol onggre
|
||||
keep - - - onyyfnpx
|
||||
drop onat
|
||||
keep - - - onfgneq
|
||||
keep - - - orna dhrra
|
||||
keep - - whole ornare
|
||||
keep - - - orng bss
|
||||
keep - - - oryyraq
|
||||
drop oraqre
|
||||
keep swearing - - ovgpu
|
||||
keep - - whole oynpxl
|
||||
keep - - - oybj n ybnq
|
||||
keep - - - oybjwbo
|
||||
keep - - - oyhzcxva
|
||||
keep - - - obvbynf
|
||||
keep - - - obyybpxf
|
||||
drop obaqntr
|
||||
keep - - whole obare
|
||||
drop obax
|
||||
keep - - whole obbof
|
||||
drop obbgl
|
||||
drop oernfg
|
||||
keep - - whole ohttre
|
||||
drop ohz
|
||||
drop ohat
|
||||
keep - mild whole ohgg
|
||||
drop ohggrezvyx
|
||||
keep - - - pnzry wbpxrl
|
||||
keep - - - pnzrygbr
|
||||
keep slurs - - pnecrg zhapure
|
||||
keep - - - puvan ivehf
|
||||
keep - - - puvatpubat
|
||||
keep - - whole puvax
|
||||
keep - - - pubnq
|
||||
keep - - - pubpun
|
||||
keep - - - pubxr gur puvpxra
|
||||
drop pubyb
|
||||
keep - - - pyvg
|
||||
keep - - whole pbpx
|
||||
drop pbwbarf
|
||||
keep - - whole pbbyvr
|
||||
keep - - whole pbba
|
||||
drop pbbg
|
||||
drop pbbgvrf
|
||||
keep - - - pbggba cvpxre
|
||||
keep - - - pernzcvr
|
||||
drop pebgpu
|
||||
drop pebj
|
||||
keep - - whole phz
|
||||
keep - - - phaavyvathf
|
||||
keep - - anywhere phag
|
||||
keep - - whole qntb
|
||||
keep - mild - qnza
|
||||
keep - - whole qnexl
|
||||
keep - - whole qvpx
|
||||
keep - - whole qvqqyr
|
||||
keep - - - qvyqb
|
||||
drop qvcfgvpx
|
||||
keep - - - qvegl fnapurm
|
||||
keep - - - qbttl fglyr
|
||||
keep insults - whole qbyg
|
||||
drop qbat
|
||||
keep - - - qbgurnq
|
||||
drop qbhoyr cra
|
||||
keep - - whole qbhpur
|
||||
keep - - - qhzc n ybnq
|
||||
keep - - whole qlxr
|
||||
drop rwnphyngvba
|
||||
keep - - - rerpgbcynfz
|
||||
keep - - whole snt
|
||||
keep - - anywhere snttbg
|
||||
keep - - whole sneg
|
||||
keep - - - sryyngvb
|
||||
drop svatre
|
||||
keep - - whole synzre
|
||||
drop sberfxva
|
||||
keep - - anywhere shpx
|
||||
keep slurs - - shqtr cnpxre
|
||||
keep - - - shaontf
|
||||
drop tneontr ont
|
||||
keep - - - tnfu-fgnoore
|
||||
drop tnl
|
||||
keep - - - tva wbpxrl
|
||||
keep - - - tveyl ovgf
|
||||
keep insults - - tveylobl
|
||||
keep - - whole tbbx
|
||||
keep - - whole tbjy
|
||||
drop ternfre
|
||||
keep - - start tebvq
|
||||
drop tebcr
|
||||
keep - - whole tlcfl
|
||||
drop unt
|
||||
keep - - - uneel cnyzf
|
||||
keep - - whole uror
|
||||
keep - - whole uryy
|
||||
keep swearing - whole ubr
|
||||
drop ubzbfrkhny
|
||||
drop ubbgref
|
||||
drop uhfgyre
|
||||
keep - - whole vawha
|
||||
keep - - - wnpx bss
|
||||
keep - - - wnpxbss
|
||||
keep - - - wnvyonvg
|
||||
keep - - whole wnc
|
||||
keep - - whole wrex
|
||||
keep - - - wrex bss
|
||||
drop wrj
|
||||
keep - - - wvttnobb
|
||||
drop wvz pebj
|
||||
keep - - - wvmm
|
||||
keep - - - xvqgbhpure
|
||||
keep - - whole xvxr
|
||||
keep - - - xvggl chapure
|
||||
keep slurs - whole xxx
|
||||
keep - - whole xyna
|
||||
keep - strong whole xabo
|
||||
keep - - - xh xyhkre
|
||||
keep - - - ynqlobl
|
||||
drop yrfovna
|
||||
drop ybbfr
|
||||
keep - - - zna pubjqre
|
||||
keep - - - zna frrq
|
||||
keep - - - znfgheongr
|
||||
drop zrng
|
||||
keep - - - zrng phegnvaf
|
||||
keep - - - zvys
|
||||
drop zbyrfg
|
||||
keep - - whole zbat
|
||||
keep - - whole zbatbybvq
|
||||
drop zbatery
|
||||
drop zbaxrl
|
||||
keep - - - zbgureshpxre
|
||||
keep - - whole zhss
|
||||
keep - - - zhfuebbz gvc
|
||||
keep - - whole arteb
|
||||
keep - - anywhere avttn
|
||||
keep - - anywhere avttre
|
||||
keep - - - avttref
|
||||
keep - - - avtttre
|
||||
drop avccyr
|
||||
keep - - whole abapr
|
||||
drop ahg ohggre
|
||||
keep - - - ahgfnpx
|
||||
drop alzcu
|
||||
keep - - - betnfz
|
||||
keep - - - bira qbqtre
|
||||
keep - - whole cnxv
|
||||
keep - - - cnyz wbpxrl
|
||||
keep - - - cnapnxr snpr
|
||||
keep - - whole crpxre
|
||||
keep insults - - crqbcuvyr
|
||||
drop cravf
|
||||
keep - - - crgre chssre
|
||||
drop cvt
|
||||
keep slurs - - cvyybj ovgre
|
||||
keep - - - cvff
|
||||
keep - - - cbyr yvpxre
|
||||
keep - - - cbyr fzbxre
|
||||
keep - - - cbyr fhpxre
|
||||
keep - - - cbyrfzbxre
|
||||
keep - - - cbepu zbaxrl
|
||||
keep - - whole cevpx
|
||||
keep - - - chyy gur chq
|
||||
keep - - - chanav
|
||||
drop chagn
|
||||
keep - - whole chffl
|
||||
drop dhrre
|
||||
keep - - - enturnq
|
||||
drop enzebq
|
||||
keep - - - ernpunebhaq
|
||||
drop erpghz
|
||||
keep - - - erqfxva
|
||||
keep - - whole ergneq
|
||||
keep - - whole ergneqrq
|
||||
keep - - - evz wbo
|
||||
drop fnqbznfbpuvfz
|
||||
keep - - - fnynq gbffre
|
||||
keep - - whole fnzob
|
||||
keep - - - fnhfntr wbpxrl
|
||||
keep - - - fpuybat
|
||||
keep insults - whole fphz
|
||||
drop fphg
|
||||
drop frk
|
||||
keep - - - furznyr
|
||||
drop fuvrfgre
|
||||
keep - - anywhere fuvg
|
||||
keep - - - fuybat
|
||||
keep - - whole fulybpx
|
||||
keep insults - whole fvffl
|
||||
keep swearing - - fxnax
|
||||
keep swearing - whole fynt
|
||||
keep - - - fynag rlr
|
||||
drop fyvg
|
||||
keep swearing - - fyhg
|
||||
drop fangpu
|
||||
drop fcnax
|
||||
drop fcrez
|
||||
drop fcuvapgre
|
||||
keep - - whole fcvp
|
||||
drop fcbbx
|
||||
drop fchax
|
||||
keep - - - fghzc purjre
|
||||
drop fhpx
|
||||
drop fjvar
|
||||
keep - - - gnpburnq
|
||||
keep - - - gnqtre
|
||||
keep - - - gnxvat gur cvff
|
||||
keep - - - gnyyljnpxre
|
||||
keep - - - gne-onol
|
||||
drop gneg
|
||||
drop grfgvpyrf
|
||||
keep - - - guebng lbtheg
|
||||
keep - - - guebngre
|
||||
keep - - - gvpxyr gur cvpxyr
|
||||
keep - - whole gvg
|
||||
keep - - whole gvgf
|
||||
keep - - whole gbffre
|
||||
keep - - - gbffvat fnynq
|
||||
keep - - - gbjryurnq
|
||||
drop genzc
|
||||
keep - - whole genaal
|
||||
drop genafirfgvgr
|
||||
drop genfu
|
||||
keep - - - gebhfre fanxr
|
||||
keep - - - gebhfrefanxr
|
||||
keep - - whole gheq
|
||||
keep - - - gjng
|
||||
drop gjvax
|
||||
keep - - - hcfxveg
|
||||
drop intvan
|
||||
drop ihyin
|
||||
drop jnat
|
||||
keep - - - jnax
|
||||
drop jrravr
|
||||
drop jrvare
|
||||
keep - - - jrgonpx
|
||||
keep - - - junpx bss
|
||||
keep swearing - - juber
|
||||
keep - - - jvyyl-junpxre
|
||||
keep - - - jvaqbj yvpxre
|
||||
keep - - whole jbc
|
||||
drop jbhaq
|
||||
keep - - - mvccreurnq
|
||||
|
||||
# spellings of kept words that are everyday words, or another's initials
|
||||
drop onfgvanqb
|
||||
drop crgre
|
||||
drop ahttrgf
|
||||
drop ahttrg
|
||||
drop xavpxref
|
||||
drop avpxre
|
||||
drop avpxref
|
||||
drop fnpx
|
||||
drop ongre
|
||||
drop ongrf
|
||||
drop abof
|
||||
drop abo
|
||||
drop fbof
|
||||
drop fbo
|
||||
drop ubne
|
||||
drop chfflpng
|
||||
drop chffrf
|
||||
drop chff
|
||||
drop qvk
|
||||
drop srq
|
||||
drop sre
|
||||
drop srt
|
||||
drop sbexrq
|
||||
drop furrg
|
||||
drop oop
|
||||
drop ojp
|
||||
drop ow
|
||||
drop fcvpx
|
||||
|
||||
# The project's own words, which Surge AI's list has not: sexual words and
|
||||
# those for sexualised minors, hate phrases, and harassment (a term's
|
||||
# severity puts it under the default levels: slurs mild, swearing strong)
|
||||
term swearing strong anywhere cbea
|
||||
term swearing strong anywhere uragnv
|
||||
term swearing strong whole ahqrf
|
||||
term swearing mild whole ubeal
|
||||
term swearing strong start vaprfg
|
||||
term swearing severe - orfgvnyvgl
|
||||
term swearing severe start mbbcuvy
|
||||
term swearing strong - lvss
|
||||
term swearing strong whole shgn
|
||||
term swearing strong - shgnanev
|
||||
term swearing strong - nurtnb
|
||||
term swearing strong - pnztvey
|
||||
term swearing severe whole ybyv
|
||||
term swearing severe - ybyvpba
|
||||
term swearing severe whole fubgn
|
||||
term swearing severe - fubgnpba
|
||||
term swearing strong whole encr
|
||||
term swearing strong whole encvfg
|
||||
term slurs severe - shesnt
|
||||
term slurs severe - urvyuvgyre
|
||||
term slurs severe - fvrturvy
|
||||
term insults strong whole xlf
|
||||
term insults severe - xvyylbhefrys
|
||||
term insults severe - xvyyhefrys
|
||||
term insults strong whole gubg
|
||||
term insults mild whole phpx
|
||||
@@ -280,6 +280,62 @@ as it changes), for the scoreboard, whose right click frees the mouse to
|
||||
pick a player; the host's own scoreboard adds Kick and Ban. Builds without
|
||||
votes drop both kinds as unknown, so the network version is unchanged.
|
||||
|
||||
The text chat (`network_chat.c`): a client sends its player's line to the
|
||||
host (`_distributed_message_chat_up`, reliably), which takes it only from
|
||||
the client's own stream and from one of that machine's players, at most 5
|
||||
lines at once and one each 1.5 seconds after (more are dropped; a machine
|
||||
gone from the game has its count let go, so one new to its slot starts
|
||||
afresh), its text cut to 63 characters of printable ASCII but `|` (which
|
||||
the game's text drawing takes for the start of a code; it becomes `?`, on
|
||||
the host and again on each client). The host alone sends the line on
|
||||
(`_distributed_message_chat_down`, reliably, with the sender's absolute
|
||||
index and its channel, the line's flags): to every client, a team's line
|
||||
only to the machines with a player of the sender's team (to every one in a
|
||||
game without teams), and a vehicle's line only to those with a player
|
||||
riding in the sender's vehicle (the outermost object each unit is a child
|
||||
of, so any map's vehicles), as the host has them; the sender's machine gets
|
||||
its own line whatever it is. The host shows it itself if one of its own
|
||||
players hears it or said it. A client shows only
|
||||
the host's lines, its own too, so every machine shows them in one order,
|
||||
and takes them (and the chat settings below) only over the host's
|
||||
connection's stream: a datagram from the host's address could be anyone's.
|
||||
Each local player's view shows the lines that player hears.
|
||||
The host's own `/mute <player> [minutes]` and `/unmute <player>` are
|
||||
commands, not lines: it keeps a mute by the player's name (in ASCII,
|
||||
matched in either case, as the host keeps names apart) and its minutes by
|
||||
its own clock, drops the lines of a muted player's machine
|
||||
when they come up, and sends that machine alone a notice of the minutes
|
||||
left; it tells every machine of each mute and unmute. A notice is a down
|
||||
line with `_chat_line_notice_bit` set, its text alone (no sender). A
|
||||
client's `/mute` is never sent, and the host takes the text of a line that
|
||||
came up as a line, never a command. The host's scoreboard Mute for everyone
|
||||
is the same mute (20 minutes), and the host relays none of a muted player's
|
||||
machine's voice either (`network_voice.c`'s `voice_host_relay`, by the
|
||||
names of the network game's players, which the lobby has too). A
|
||||
machine's own scoreboard mute stays its own: it plays none of that
|
||||
machine's voice and shows none of its players' lines, and tells no one.
|
||||
The host's chat settings (`network.text_chat`: on, links allowed, or off;
|
||||
always off while its game is listed in the server browser,
|
||||
`p2p_hosting_listed`) go to every client in
|
||||
`_distributed_message_chat_config` (one byte of flags), reliably, as they
|
||||
change and every 3 seconds. A client without them (from a host without the
|
||||
chat, or before they come) has the chat off, and so does a client in a
|
||||
public game it joined from the server browser, whatever its host sends (a
|
||||
changed host could turn the chat on): while the tunnel reaches the host of
|
||||
the listing it joined (`p2p_join_listing`, `p2p_joined_listed_host`; any
|
||||
other invite joined since forgets it), it takes no chat line or notice and
|
||||
sends none. A client refuses a line the
|
||||
settings refuse before sending it, and the host refuses it again whatever
|
||||
the client knew, telling its machine why: a changed build gets no further.
|
||||
Links are found in the line's text (`chat_text_has_link`): a scheme, `www.`,
|
||||
an address of four numbers, or a name and a common top-level domain, its
|
||||
dots also written `(dot)`, `[dot]`, `{dot}`, `(.)`, `[.]` or ` dot `, with
|
||||
spaces about them or not, or a dot with spaces both sides; a domain that is
|
||||
a word as well (`me`, `to`, `is`) counts only with a path, a port or another
|
||||
domain after it (`chat_link_domain`).
|
||||
Builds without the chat drop the three kinds as unknown, so the network
|
||||
version is unchanged.
|
||||
|
||||
Voice chat (`network_voice.c`, the sound in `port/linux/src/voice_audio.c`)
|
||||
travels as distributed messages too, but in the lobby as well as in a game:
|
||||
`network_voice_handles_message` takes them before the netcode's checks that
|
||||
@@ -738,7 +794,18 @@ two machines' views of one game can be compared. `debug.network_test_kill`,
|
||||
`debug.network_test_shoot`, `debug.network_test_vehicle` and
|
||||
`debug.network_test_pickup` script kills, hits, a vehicle ride and a weapon
|
||||
swap the bots' wandering does not reach (`debug.network_test_pickup_weapon`
|
||||
picks the weapon: the first whose tag name has it in it, as "sniper"), and `debug.network_test_score`
|
||||
picks the weapon: the first whose tag name has it in it, as "sniper"),
|
||||
`debug.network_test_chat` has each machine's player say a chat line to
|
||||
everyone, one to the team and one to the vehicle (the host seats the last
|
||||
two players in one first), then the host mutes the last player for a
|
||||
minute, each says a line, the host unmutes them and each says another,
|
||||
each says a line with a link (a client's sent past its own check, for the
|
||||
host to refuse), the host turns the text chat off (and on again) as each
|
||||
says one more, the host mutes the last player for everyone (as its
|
||||
scoreboard does) around a line each, and the last player's machine mutes
|
||||
the host's for itself (as a client's scoreboard does) before another,
|
||||
which every machine's `debug.txt` records as
|
||||
it shows them (the notices as `chat notice:`), and `debug.network_test_score`
|
||||
shortens the game, to test the next (`host:<map>:<variant>,<variant>...`
|
||||
plays the variants in turn, the next once a game is over, as the host's
|
||||
button on the scores does). `debug.network_test_public` lists the host's
|
||||
|
||||
@@ -212,6 +212,12 @@ gamepads' only.
|
||||
| pause menu | escape |
|
||||
| screenshot | F10 |
|
||||
| talk in voice chat (hold) | V |
|
||||
| type a chat line to everyone | T |
|
||||
| type a chat line to your team | Y |
|
||||
| while typing a chat line: to everyone, the team or the vehicle, in turn | Tab |
|
||||
|
||||
With a controller, or the touch controls' D-pad, D-pad Up opens the text
|
||||
chat's on-screen keyboard (refer to "Text chat").
|
||||
|
||||
Always: \` opens the developer console, F12 releases or captures the mouse,
|
||||
F11 changes between fullscreen and window. Screenshot (default F10,
|
||||
@@ -282,6 +288,9 @@ PLAYER then START, and JOIN GAME brings them all into the game.
|
||||
|
||||
In a multiplayer game, the pause menu (escape) has SETTINGS, which opens
|
||||
the profile's settings while the game goes on, and for the host END GAME.
|
||||
There Network Setup has only its pages that work in a game (Map Sharing,
|
||||
Multiplayer HUD with the text chat, and Streamer Mode), not INTERNET PLAY,
|
||||
which would drop the game, nor the rows for the main menu.
|
||||
END GAME ends the game as its time limit does: the players stay, and after
|
||||
the carnage report the host picks the next map and gametype (PICK GAME).
|
||||
LEAVE GAME of the host still ends the game for everyone. The buttons go into
|
||||
@@ -295,7 +304,8 @@ In a single-player campaign, the pause menu has SETTINGS too, before REVERT
|
||||
TO SAVED, in the same box: a list with room for it centres its rows, and
|
||||
one without keeps its size, its rows closer. It opens the same settings,
|
||||
while the game stays paused, with only Controls, Gamepads, Mouse, Audio and
|
||||
Video Setup; Gamepads' OK saves the profile at once.
|
||||
Video Setup; Gamepads' OK saves the profile at once. In co-op the settings
|
||||
have Network Setup too, with its in-game pages as in a multiplayer game.
|
||||
|
||||
The menus are XML files in `port/assets/menus` (`tools/ce_menus.py` writes
|
||||
them from the PC version's tags), which the game contains. To change them,
|
||||
@@ -348,6 +358,8 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `display.menus` | `"pc"` | `HALO_MENUS` | `"pc"`: the PC version's menus, from the files in `port/assets/menus` and a `menus` folder next to `config.toml`. Refer to "Menus". `"xbox"`: the Xbox's menus. |
|
||||
| `display.player_names` | `"all"` | `HALO_PLAYER_NAMES` | In multiplayer, whose names are drawn above their heads: `"all"`, `"allies"`, `"enemies"` or `"none"`. An ally's name is drawn above the triangle the game shows over teammates. An enemy's name shows only within the motion sensor's reach, while the enemy is in sight and not camouflaged, so it never shows where an enemy hides. The gametype's motion tracker setting also applies: no names if it shows no players, only allies' if it shows only friends. |
|
||||
| `display.player_name_scale` | `1.0` | `HALO_PLAYER_NAME_SCALE` | How large the players' names are drawn: `1.0` is three quarters of the size of the HUD's text, from `0.25` to `4`. With high-res text, larger names are rasterized at their size, so they stay sharp. |
|
||||
| `display.text_chat` | `true` | `HALO_TEXT_CHAT` | Show the text chat of network games (Settings > Network Setup > Multiplayer HUD > TEXT CHAT). `false` hides its lines, and its keys and a controller's D-pad Up open nothing. Refer to "Text chat". |
|
||||
| `display.chat_style` | `"colors"` | `HALO_CHAT_STYLE` | The text chat's colours (Settings > Network Setup > Multiplayer HUD > CHAT TEXT): `"colors"`, the player's name in their team's colour and the text a pale blue; `"white"`, all of it white, as Custom Edition. |
|
||||
| `display.scoreboard_team_layout` | `"teams"` | `HALO_SCOREBOARD_TEAM_LAYOUT` | How the multiplayer scoreboard (hold BACK, or tab) lists a team game's players. `"teams"`: a column for each team, red on the left and blue on the right. `"score"`: all the players in order of score. With more players than fit, the mouse wheel and Page Up / Page Down scroll the scoreboard. |
|
||||
| `display.scoreboard_background` | `true` | `HALO_SCOREBOARD_BACKGROUND` | `true`: the multiplayer scoreboard (hold BACK, or tab) has a panel behind its text, for clearer text. |
|
||||
| `display.scoreboard_background_color` | `"16, 16, 16, 150"` | `HALO_SCOREBOARD_BACKGROUND_COLOR` | The colour of the scoreboard's panel: `"red, green, blue, alpha"`, each from `0` to `255`. Alpha `0` is see-through, `255` is solid. |
|
||||
@@ -367,7 +379,7 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `input.mouse_vertical_sensitivity` | `0.0` | `HALO_MOUSE_VERTICAL_SENSITIVITY` | The multiplier for the vertical mouse aim. `0`: the same as `input.mouse_sensitivity`. |
|
||||
| `input.invert_mouse` | `false` | `HALO_MOUSE_INVERT=1` sets `true` | `true`: the vertical mouse aim is inverted. |
|
||||
| `input.mouse_aim_assist` | `false` | `HALO_MOUSE_AIM_ASSIST` | `true`: the magnetism of the controller also operates for the mouse. `false`: when the mouse moved after the right stick, the view is not slowed or dragged by a target. The autoaim of the bullets operates in both cases. |
|
||||
| `controls.<action>` | (the table in "Controls") | `HALO_KEY_<ACTION>` | The keys and mouse buttons of an action, up to two, separated by a comma: `move_forward`, `move_backward`, `strafe_left`, `strafe_right`, `jump`, `crouch`, `fire`, `throw_grenade`, `melee`, `reload`, `zoom`, `switch_weapon`, `switch_grenade`, `action`, `flashlight`, `scoreboard`, `pause`, `screenshot`, `push_to_talk`. Keys by their names (`"W"`, `"Space"`, `"Left Ctrl"`, `"F1"`), and `"Mouse Left"`, `"Mouse Right"`, `"Mouse Middle"`, `"Mouse 4"`, `"Mouse 5"`, `"Wheel"` (either way), `"Wheel Up"`, `"Wheel Down"`. |
|
||||
| `controls.<action>` | (the table in "Controls") | `HALO_KEY_<ACTION>` | The keys and mouse buttons of an action, up to two, separated by a comma: `move_forward`, `move_backward`, `strafe_left`, `strafe_right`, `jump`, `crouch`, `fire`, `throw_grenade`, `melee`, `reload`, `zoom`, `switch_weapon`, `switch_grenade`, `action`, `flashlight`, `scoreboard`, `pause`, `screenshot`, `push_to_talk`, `chat`, `team_chat`. Keys by their names (`"W"`, `"Space"`, `"Left Ctrl"`, `"F1"`), and `"Mouse Left"`, `"Mouse Right"`, `"Mouse Middle"`, `"Mouse 4"`, `"Mouse 5"`, `"Wheel"` (either way), `"Wheel Up"`, `"Wheel Down"`. |
|
||||
| `game.console_log` | `"important"` | `HALO_CONSOLE_LOG` | What the console shows on the screen. `"important"`: bans, players that the host drops for cheating, the reasons that the game refuses a command, and the asserts that stop the game. `"all"`: all the lines. `"none"`: only the asserts that stop the game. The output of a command always shows. `debug.txt` gets all the lines. |
|
||||
| `game.language` | `""` | `HALO_LANGUAGE` | The language of the menus: `ja`, `de`, `fr`, `es` or `it`. Empty: English. |
|
||||
| `game.enhanced_animations` | `true` | `HALO_ENHANCED_ANIMATIONS` | `true`: the player bipeds' grenade throws keep their legs moving, blended by speed and direction (crouched throws stay crouched, throws in the air use the jump's legs), Warthog and Scorpion riders stay seated to throw and let go of the grips to throw and reload, and a player turns with the aim while throwing, as while meleeing. `false`: the original animations, which freeze the legs during a throw and stand a rider up. Only in config.toml, not in the menus. |
|
||||
@@ -390,19 +402,24 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.voice_mode` | `"team_global_enemy_proximity"` | `HALO_NET_VOICE_MODE` | When you host: who hears whom during a game. `"off"`; `"team_proximity"` (teammates who are near); `"team_enemy_proximity"` (all players who are near); `"team_global"` (all teammates); `"team_global_enemy_proximity"` (all teammates, and enemies who are near). Refer to "Voice chat". |
|
||||
| `network.voice_kbps` | `24` | `HALO_NET_VOICE_KBPS` | When you host: the voice quality in the lobby and in a game, in kilobits per second, `8` to `64`. |
|
||||
| `network.voice_proximity` | `15.0` | `HALO_NET_VOICE_PROXIMITY` | When you host: the distance in world units (1 unit is approximately 3 metres) at which players are near, for voice chat. `5` to `100`. |
|
||||
| `network.text_chat` | `"on"` | `HALO_NET_TEXT_CHAT` | When you host: the text chat. `"on"`, lines with links refused; `"links"`, links allowed; `"off"`, no chat (in either case). Always off in a game listed in the server browser. TEXT CHAT in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. Refer to "Text chat". |
|
||||
| `network.votekick` | `true` | `HALO_NET_VOTEKICK` | When you host: `true`, the players can vote to kick a player. Refer to "Security". `false`: no votes. VOTE KICK in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. |
|
||||
| `network.votekick_minutes` | `5` | `HALO_NET_VOTEKICK_MINUTES` | When you host: the minutes that a player must play on the server before the player can start a vote to kick (`0` to `60`). To vote, a player must play for 2 minutes, or for this time if it is less. |
|
||||
| `network.votekick_ban_minutes` | `30` | `HALO_NET_VOTEKICK_BAN_MINUTES` | When you host: the minutes that a player who is kicked by a vote cannot join again (`1` to `1440`). |
|
||||
| `network.map_share` | `true` | `HALO_NET_MAP_SHARE` | When you host: send a player who joins without the game's Custom Edition map the map, and the resource maps that it needs and that the player does not have. SHARE MAPS in Server Setup > Map Sharing writes its choice here. Refer to "Map sharing". |
|
||||
| `network.map_share_upload` | `1024` | `HALO_NET_MAP_SHARE_UPLOAD` | When you host: the most kilobytes per second that the game sends of maps (`16` to `65536`). UPLOAD LIMIT in Server Setup > Map Sharing writes its choice here. |
|
||||
| `network.map_share_upload` | `1024` | `HALO_NET_MAP_SHARE_UPLOAD` | When you host: the most kilobytes per second that the game sends of maps (`16` to `20480`, 20 MB/s). UPLOAD LIMIT in Server Setup > Map Sharing writes its choice here. |
|
||||
| `network.map_seed` | `true` | `HALO_NET_MAP_SEED` | When you play in the game of another machine: help send its map to players who join without it. HELP SEND MAPS in Settings > Network Setup > Map Sharing. |
|
||||
| `network.map_seed_upload` | `256` | `HALO_NET_MAP_SEED_UPLOAD` | When you play in the game of another machine: the most kilobytes per second that the game sends of maps to other players (`16` to `65536`). UPLOAD LIMIT in Settings > Network Setup > Map Sharing. |
|
||||
| `network.map_seed_upload` | `256` | `HALO_NET_MAP_SEED_UPLOAD` | When you play in the game of another machine: the most kilobytes per second that the game sends of maps to other players (`16` to `10240`, 10 MB/s). UPLOAD LIMIT in Settings > Network Setup > Map Sharing. |
|
||||
| `network.map_download` | `true` | `HALO_NET_MAP_DOWNLOAD` | When you join a game on a Custom Edition map that you do not have: download it from the players of the game. `false`: leave the game and show which map is missing. DOWNLOAD MAPS in Settings > Network Setup > Map Sharing. |
|
||||
| `network.coop_public` | `false` | `HALO_NET_COOP_PUBLIC` | `true`: an online co-op game (Create Game > Internet, a SINGLEPLAYER map) starts as PUBLIC. `false`: it starts as PRIVATE. LISTING in co-op's Server Setup writes its choice here. Refer to "Server browser". |
|
||||
| `network.brokers_file` | `"brokers.txt"` | `HALO_NET_BROKERS_FILE` | The file of the public MQTT brokers that let the machines of an invite find each other, and that carry the listings of the server browser: next to `config.toml`, unless a full path. One `host:port` on each line, up to 4; `#` starts a comment. |
|
||||
| `network.stun_servers` | Google and Cloudflare | `HALO_NET_STUN` | The public STUN servers (`host:port`, with commas between them) that give the internet address of a machine. |
|
||||
| `discord.application_id` | the application of the project | `HALO_DISCORD_APPLICATION` | The Discord application for invites. Empty: no Discord. |
|
||||
| `update.auto` | `true` | `HALO_UPDATE_AUTO` | `true`: at start-up, the game looks for a new version. Refer to "Updates". `false`: the game does not look. |
|
||||
| `streamer.enabled` | `false` | `HALO_STREAMER_MODE` | `true`: streamer mode hides offensive words, as stars, in the names and text of other players, maps and mods, at the levels below. Refer to "Streamer mode". STREAMER MODE in Settings > Network Setup > Streamer Mode. |
|
||||
| `streamer.slurs` | `"mild"` | `HALO_STREAMER_SLURS` | With `streamer.enabled`, the slurs (race, ethnicity, sexuality, gender, disability) hidden: `"off"`, `"severe"`, `"strong"` (strong and severe) or `"mild"` (all). CENSOR SLURS in Settings > Network Setup > Streamer Mode. |
|
||||
| `streamer.swearing` | `"strong"` | `HALO_STREAMER_SWEARING` | With `streamer.enabled`, the swearing and sexual words hidden: `"off"`, `"severe"`, `"strong"` or `"mild"`. CENSOR SWEARING in Settings > Network Setup > Streamer Mode. |
|
||||
| `streamer.insults` | `"off"` | `HALO_STREAMER_INSULTS` | With `streamer.enabled`, the insults that are not slurs hidden: `"off"`, `"severe"`, `"strong"` or `"mild"`. CENSOR INSULTS in Settings > Network Setup > Streamer Mode. |
|
||||
| `crash_reports.upload` | `"ask"` | `HALO_CRASH_REPORTS` | Windows only. `"yes"`: the game sends a report of each crash to the developers. `"no"`: the game sends no reports. `"ask"`: the game asks at the next crash and writes the answer here. Refer to "Crash reports" in [port/windows/README.md](../windows/README.md#crash-reports). |
|
||||
| `debug.update_answer` | `""` | `HALO_UPDATE_ANSWER` | The answer to the update question, for automatic tests: `yes`, `no` or `never`. Empty: the game asks. |
|
||||
| `debug.exit_after` | `0.0` | `HALO_EXIT_AFTER` | The game stops after this number of seconds. `0`: never. |
|
||||
@@ -411,7 +428,7 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `debug.gpu_stats`, `debug.gpu_trace_frame`, `debug.gpu_trace_constants`, `debug.gpu_dump_shaders`, `debug.texture_dump_directory`, `debug.texture_log`, `debug.gl_debug`, `debug.texture_no_cache` | off | `HALO_GPU_STATS`, `HALO_GPU_TRACE`, `HALO_GPU_TRACE_CONSTANTS`, `HALO_GPU_DUMP_SHADERS`, `HALO_TEXTURE_DUMP`, `HALO_TEXTURE_LOG`, `HALO_GL_DEBUG`, `HALO_TEXTURE_NO_CACHE` | Tools to find problems in the graphics: counts for each frame, all the GL state of one frame, the GLSL code, the textures. |
|
||||
| `debug.menu_open` | `""` | `HALO_MENU_OPEN` | Start on this screen of the menus (`main_menu/settings_select/...`, as `port/assets/menus` names it), a player profile being edited, to look at it. |
|
||||
| `debug.gpu_skip_vertex_shaders`, `debug.gpu_debug_expression`, `debug.gpu_debug_flat`, `debug.gpu_debug_texture0` | off | `HALO_GPU_SKIP_VS`, `HALO_GPU_DEBUG_EXPR`, `HALO_GPU_DEBUG_FLAT`, `HALO_GPU_DEBUG_T0` | Tools to find problems in the graphics: skip the draws of a vertex shader, or replace the output of all pixel shaders with a GLSL expression (for example `t0.rgb`). |
|
||||
| `debug.network_test`, `debug.network_test_start`, `debug.network_test_kill`, `debug.network_test_score`, `debug.network_test_shoot`, `debug.network_test_vehicle`, `debug.network_test_pickup`, `debug.network_test_pickup_weapon`, `debug.network_test_public`, `debug.test_input` | off | `HALO_NETWORK_TEST`, `HALO_NETWORK_TEST_START`, `HALO_NETWORK_TEST_KILL`, `HALO_NETWORK_TEST_SCORE`, `HALO_NETWORK_TEST_SHOOT`, `HALO_NETWORK_TEST_VEHICLE`, `HALO_NETWORK_TEST_PICKUP`, `HALO_NETWORK_TEST_PICKUP_WEAPON`, `HALO_NETWORK_TEST_PUBLIC`, `HALO_TEST_INPUT` | Automatic tests of system link (`game/network_test.c`). Refer to `NETCODE.md`. |
|
||||
| `debug.network_test`, `debug.network_test_start`, `debug.network_test_kill`, `debug.network_test_score`, `debug.network_test_shoot`, `debug.network_test_vehicle`, `debug.network_test_pickup`, `debug.network_test_pickup_weapon`, `debug.network_test_chat`, `debug.network_test_name`, `debug.network_test_public`, `debug.test_input` | off | `HALO_NETWORK_TEST`, `HALO_NETWORK_TEST_START`, `HALO_NETWORK_TEST_KILL`, `HALO_NETWORK_TEST_SCORE`, `HALO_NETWORK_TEST_SHOOT`, `HALO_NETWORK_TEST_VEHICLE`, `HALO_NETWORK_TEST_PICKUP`, `HALO_NETWORK_TEST_PICKUP_WEAPON`, `HALO_NETWORK_TEST_CHAT`, `HALO_NETWORK_TEST_NAME`, `HALO_NETWORK_TEST_PUBLIC`, `HALO_TEST_INPUT` | Automatic tests of system link (`game/network_test.c`). Refer to `NETCODE.md`. |
|
||||
| `debug.touch_targets` | `false` | `HALO_TOUCH_TARGETS` | Outlines the tap targets of the menus (item green, value blue, list slot yellow, legend button red, the band beside the slots of a list orange, keys of the on-screen keyboard white), marks where the last finger went down and the last tap landed for 3 seconds, and logs each tap with the target that it hit (for a value, also where it splits into previous and next): to judge the accuracy of touch. |
|
||||
| `debug.network_latency`, `debug.network_loss`, `debug.network_corrupt`, `debug.network_corrupt_stream`, `debug.network_corrupt_after` | `0` | `HALO_NETWORK_LATENCY`, `HALO_NETWORK_LOSS`, `HALO_NETWORK_CORRUPT`, `HALO_NETWORK_CORRUPT_STREAM`, `HALO_NETWORK_CORRUPT_AFTER` | The game holds all the data that it receives for this number of milliseconds, ignores this percentage of the datagrams, and damages this percentage of the datagrams it receives, and this percentage of its reads of streams, at random (bytes changed, cut short, stretched or replaced), from this many seconds after the start. Use the first two to test the netcode as on the internet, and the others to test that nothing another machine sends can crash the game (a damaged stream is closed, so a little goes a long way; a host's messages to its own client are damaged too, so start damaging once the game has started). |
|
||||
| `debug.voice_test` | `false` | `HALO_VOICE_TEST` | Automatic tests of voice chat: a tone replaces the microphone, and each voice that the game hears is written to the log once each second. |
|
||||
@@ -656,6 +673,98 @@ as between native builds, two networks that do not let a direct connection
|
||||
through (some company and school networks block WebRTC) cannot play
|
||||
together.
|
||||
|
||||
### Text chat
|
||||
|
||||
Network games have a text chat, as the PC version had. Press T
|
||||
(`controls.chat`) to type a line to all the players, or Y
|
||||
(`controls.team_chat`) to type one to your team (in a game without teams,
|
||||
to all the players). While you type, Tab changes who the line is to, in
|
||||
turn: all the players, your team, or your vehicle (the players riding in
|
||||
the vehicle you ride in, whatever the map's vehicles are, Custom Edition
|
||||
maps' too; on foot, only you see it). Enter sends the line, Escape cancels
|
||||
it. While you type, your player does not move.
|
||||
|
||||
With a controller, D-pad Up opens an on-screen keyboard at the bottom right
|
||||
(on Android, at the bottom in the middle) for a line to all the players:
|
||||
the left stick (or D-pad Left and Right) moves between the keys, A types
|
||||
the key, X deletes, Y switches capitals, D-pad Up and Down change who the
|
||||
line is to (all the players, your team, your vehicle), Start sends the
|
||||
line, and B closes the keyboard (the button that closed it does nothing in
|
||||
the game until you let it go). Its last row has Aa (capitals), #+= (the
|
||||
symbols), space, DEL and SEND. On a touchscreen (Android, and a browser on
|
||||
a phone or tablet), the touch controls' D-pad Up opens it, a tap on a key
|
||||
types it, and a tap anywhere else closes it: the touch controls hide while
|
||||
it is up. While the keyboard is up the controller and the touch controls
|
||||
move nothing in the game. The face buttons are the same places on
|
||||
other controllers (on a PlayStation controller: Cross types, Square
|
||||
deletes, Triangle switches capitals, Circle closes).
|
||||
|
||||
The lines show above the motion sensor, in a column a little over half the
|
||||
screen wide: a long line wraps onto the next rows, and the line you type
|
||||
shows its end when it is wider. The player's name is in the colour of
|
||||
their team (blue in a game without teams), the text in a pale blue, and the
|
||||
host's notices in a pale gold; WHITE in CHAT TEXT in Settings > Network
|
||||
Setup > Multiplayer HUD (`display.chat_style`) draws them all white, as
|
||||
Custom Edition does. A line to the
|
||||
team says "(team)" after the name, one to the vehicle "(vehicle)". The
|
||||
lines go after ten seconds; while you type, the last six rows show. Where
|
||||
the touch controls are (Android, and a browser whose touch controls you
|
||||
use), the lines go at the top left, the newest highest. In split screen,
|
||||
each player's view shows the lines that player hears, and the first player
|
||||
types. No line shows, and none can be typed, in a menu, in a cinematic or
|
||||
while the HUD is hidden; opening a menu ends the line being typed. A new
|
||||
game starts with no lines. A line has 63 characters at most, letters,
|
||||
numbers and punctuation but `|` only (ASCII; `|` becomes `?`). `debug.txt`
|
||||
gets every line.
|
||||
|
||||
Streamer mode (refer to "Streamer mode") hides offensive words in the
|
||||
chat's lines and players' names as it does in all the text the game draws:
|
||||
only on your screen, never in what is sent, and never in the line you are
|
||||
typing.
|
||||
|
||||
The host sends each line on: a player of an older build does not see the
|
||||
lines and cannot send them. The host takes 5 lines at once from a machine,
|
||||
then one each 1.5 seconds; a machine that joins starts afresh.
|
||||
|
||||
TEXT CHAT in Settings > Network Setup > Multiplayer HUD (`display.text_chat`)
|
||||
can HIDE the chat entirely, for purists and streamers: no lines show, and
|
||||
its keys open nothing.
|
||||
|
||||
The host chooses the text chat for its games with TEXT CHAT in Server
|
||||
Setup > Teamplay Options (in co-op, Voice and Voting; `network.text_chat`):
|
||||
ON (the default: a line with a link, such as `discord.gg/...`,
|
||||
`example.com`, `www.`, an address, or `example [dot] com`, is refused),
|
||||
WITH LINKS, or OFF. A domain that is a word as well (`.me`, `.to`, `.is`)
|
||||
counts only with a path after it (`youtu.be/...`), so that `go.to` and
|
||||
`he.is` are not refused. A game listed in
|
||||
the server browser (a public internet game) never has the text chat,
|
||||
whatever it says (TEXT CHAT shows OFF there, and cannot be changed, while
|
||||
LISTING is PUBLIC); a private game, joined by its invite, and a LAN game have
|
||||
it as chosen. A player who joins a game from the server browser has no text
|
||||
chat in it even if its host turns it on: their game takes no line from that
|
||||
host and sends none. Pressing T where the chat is off says so, and a refused line
|
||||
tells its sender why.
|
||||
|
||||
On the scoreboard (right-click, then click the player), Mute voice and chat
|
||||
mutes a player for you alone: you no longer see their lines or hear their
|
||||
voice, and nobody else is told. The host's scoreboard also has Mute for
|
||||
everyone: no machine sees the player's lines or hears their voice for 20
|
||||
minutes, or until the host picks Unmute for everyone, and all the players
|
||||
see "Milenko muted for 20 minutes". The mute holds in the lobby too. A
|
||||
machine's voice is one: muting one of two players in split screen mutes
|
||||
the other's voice too.
|
||||
|
||||
The host can also mute a player from the chat: type `/mute <player>
|
||||
<minutes>`, as `/mute Milenko 5` (20 minutes when you give none, 1440 at
|
||||
most), which mutes their voice too. The player is found as the console's `kick` finds one: the whole
|
||||
name in either case, else the one player whose name begins with what you
|
||||
typed. All the players see "Milenko muted for 5 minutes". The muted
|
||||
player's lines go to no one, and they see how many minutes are left. The
|
||||
mute ends when its minutes are up, or with `/unmute <player>`. A player
|
||||
who leaves and joins again under the same name, in either case, is still
|
||||
muted. Only the
|
||||
host mutes: a player's `/mute` is not sent.
|
||||
|
||||
### Voice chat
|
||||
|
||||
Network games have voice chat, on the local network and on the internet.
|
||||
@@ -688,8 +797,10 @@ A speaker shows next to the name of a player who talks: in the lobby, on
|
||||
the scoreboard, in a list at the left of the screen during a game, and
|
||||
beside the name above their head (when names are shown there:
|
||||
`display.player_names`). To mute a player, open the scoreboard,
|
||||
right-click, click the player, and click Mute voice. You no longer hear
|
||||
them, and nobody else is told.
|
||||
right-click, click the player, and click Mute voice and chat. You no longer
|
||||
hear them or see their text chat lines, and nobody else is told. The host's
|
||||
Mute for everyone silences a player's voice for every machine (refer to
|
||||
"Text chat").
|
||||
|
||||
The host sends each voice on to the players who can hear it. The host
|
||||
accepts a voice only from the machine of the player (with a key that it
|
||||
@@ -991,6 +1102,48 @@ checks every file before it plays it, and leaves out (with a line in
|
||||
replaces. A mod changes nothing that the machines of a
|
||||
network game agree on. Refer to [docs/mods.md](../../docs/mods.md).
|
||||
|
||||
## Streamer mode
|
||||
|
||||
Streamer mode (Settings > Network Setup > Streamer Mode, `streamer.enabled`)
|
||||
hides offensive words as stars wherever the game draws text that other
|
||||
people or files wrote: the text chat's lines, players' names over their
|
||||
heads, in the chat, in the kill feed, on
|
||||
the scoreboards and in the lobbies, the server browser's games, the host's
|
||||
notices in the console, map and mod names, and the text of a map's or mod's
|
||||
own string lists, as well as the message boxes about mods and maps. It
|
||||
changes only what this machine shows: the names others see, and what the
|
||||
machines send each other, stay as they are.
|
||||
|
||||
The words come from Surge AI's rated list of English profanities, reviewed
|
||||
for the game (`port/assets/text_filter`), in three groups, each with a level
|
||||
that hides that severity and worse:
|
||||
|
||||
| Group | Setting | Default | What it has |
|
||||
| --- | --- | --- | --- |
|
||||
| SLURS | `streamer.slurs` | `"mild"` (all) | Slurs about race, ethnicity, nationality, religion, sexuality, gender and disability |
|
||||
| SWEARING | `streamer.swearing` | `"strong"` | Swearing and sexual words; the mildest (damn, hell) show at `"strong"` |
|
||||
| INSULTS | `streamer.insults` | `"off"` | Name-calling that is not a slur |
|
||||
|
||||
A word is found however it is dressed: in capitals or with accents, in
|
||||
look-alike letters (Cyrillic, Greek, full-width, small capitals), in leet
|
||||
(`0` for o, `@` for a, `ph` for f), with its letters stretched ("fuuuck"),
|
||||
with punctuation between them (`f.u.c.k`), spaced out (`f u c k`, `fu ck`),
|
||||
and with characters the game does not draw (zero-width spaces, the menus'
|
||||
`|` codes) between them. Each word may be found inside a name, at a word's
|
||||
start, or only as a whole word, as fits it, and some words are never
|
||||
hidden though a hidden one is inside them (Scunthorpe). `python3
|
||||
tools/text_filter_terms.py --check "some text"` shows what would be hidden.
|
||||
|
||||
What it cannot catch: letters added into a word or its letters scrambled, new
|
||||
spellings, a word split between two names or two lines, voice chat (mute a
|
||||
player from the scoreboard, or set `audio.voice_volume` to 0), and pictures.
|
||||
What you type is shown as you type it.
|
||||
|
||||
Your own words: `text_filter.txt` in the data root, with lines of `add
|
||||
<word>` (hidden whenever streamer mode is on) and `allow <word>` (never
|
||||
hidden), read when the game starts and when the settings change. The web
|
||||
build's page draws its own list of mods, which is not filtered.
|
||||
|
||||
## Map checks
|
||||
|
||||
The game reads a map's tags straight into memory and uses them as its own
|
||||
@@ -1168,6 +1321,7 @@ Other changes:
|
||||
| `rasterizer/rasterizer.c` | The 128 KB of vertices of the debug display of a model's vertices are static, not on the stack: the compiler inlines the function in `render_model`, and the Windows build probed the stack a page at a time for every model drawn. |
|
||||
| `render/render.c` | The 3D view of each window is antialiased before the HUD is drawn (`display.anti_aliasing`). |
|
||||
| `interface/hud.c` | In multiplayer, players' names are drawn above their heads (`display.player_names`, `display.player_name_scale`). |
|
||||
| `text/draw_string.c`, `interface/terminal.c`, `interface/virtual_keyboard.c` | Streamer mode's words are hidden in every string drawn or measured (`game/text_filter.c`), but in the console's line and the virtual keyboard's text being typed. |
|
||||
| `rasterizer/rasterizer_text.c`, `text/draw_string.c` | Text is drawn from an atlas of the fonts' glyphs, rasterized at the resolution the game draws at (`src/text_hires.c`), when the font has every character of the string. Text can be drawn scaled about a point (`rasterizer_text_set_scale`), as the players' names are. Each glyph's advance is centred on the font tag character's, so the layout is the same, and a glyph is cut at a text box only where the font tag's character visibly was. |
|
||||
| `interface/first_person_weapons.c` | The first-person hands are drawn with the unit's shield modifier shader, as its body is (`display.viewmodel_shield`). |
|
||||
| `render/render_objects.c`, `objects/objects.c` | In first person, your own body is drawn from the waist down with the pose `first_person_legs.c` makes (`display.first_person_legs`); the waist it found and the mesh `object_mesh.c` read are forgotten on a new map. |
|
||||
@@ -1182,6 +1336,7 @@ Other changes:
|
||||
| `cutscene/cinematics.c` | A scenario's titles (some Custom Edition maps show their name for the whole game) are not drawn over a menu, as the letterbox is not: the screen's overlays are drawn after the players' menus. |
|
||||
| `tag_files/tag_groups.h` | `TAG_BLOCK_GET_ELEMENT` returns an element in the block without a call, and calls `tag_block_get_element_with_size` for anything else. |
|
||||
| `input/input_xbox.c`, `physics/collision_usage.c` | The clock is read only for a button held, and for collision tests only when their times are shown: a read of the clock is slow in a browser. |
|
||||
| `main/main.c`, `interface/hud.c`, `interface/hud_unit.c`, `interface/hud_draw.c`, `game/game_engine.c` | The text chat of network games (`game/network_chat.c`): its keys are read each frame, and the debug keys are not while a line is typed; each view's HUD draws its lines, above the motion sensor, whose place the HUD notes (the left of the last picture drawn); the scoreboard's menu has Mute voice and chat, and the host's Mute for everyone. |
|
||||
|
||||
The x86 inline assembly of the game is replaced by C. Thus the compiler
|
||||
can optimize that code for each processor:
|
||||
|
||||
@@ -160,9 +160,11 @@ enum
|
||||
MAXIMUM_MAP_BYTES = 0x30000000,
|
||||
MAXIMUM_RESOURCE_MAP_BYTES = 0x20000000,
|
||||
|
||||
/* the kilobytes a second a machine sends, at least and at most */
|
||||
/* the kilobytes a second a machine sends, at least and at most: the
|
||||
host 20 MB/s, a player helping it 10 MB/s */
|
||||
MINIMUM_UPLOAD_KILOBYTES = 16,
|
||||
MAXIMUM_UPLOAD_KILOBYTES = 65536,
|
||||
MAXIMUM_HOST_UPLOAD_KILOBYTES = 20480,
|
||||
MAXIMUM_SEED_UPLOAD_KILOBYTES = 10240,
|
||||
|
||||
/* network_server_manager.c's host state in game, transport_endpoint_winsock.c's
|
||||
stream endpoint and hud_messaging.c's centred text (their enums are their
|
||||
@@ -659,10 +661,11 @@ static unsigned long map_share_host_address(
|
||||
static long upload_limit(
|
||||
void)
|
||||
{
|
||||
long kilobytes = map_share_host() ? config_integer("network.map_share_upload") :
|
||||
config_integer("network.map_seed_upload");
|
||||
boolean host = map_share_host();
|
||||
long kilobytes = host ? config_integer("network.map_share_upload") : config_integer("network.map_seed_upload");
|
||||
|
||||
return PIN(kilobytes, MINIMUM_UPLOAD_KILOBYTES, MAXIMUM_UPLOAD_KILOBYTES) * 1024;
|
||||
return PIN(kilobytes, MINIMUM_UPLOAD_KILOBYTES, host ? MAXIMUM_HOST_UPLOAD_KILOBYTES : MAXIMUM_SEED_UPLOAD_KILOBYTES) *
|
||||
1024;
|
||||
}
|
||||
|
||||
/* whether this machine sends the game's files to the others: in a game on
|
||||
|
||||
@@ -85,6 +85,7 @@ their handlers open opens.
|
||||
#include "text/draw_string.h"
|
||||
/* (internet play's server browser: the platform layer's) */
|
||||
#include "../src/p2p.h"
|
||||
#include "text_filter.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -1977,7 +1978,9 @@ static struct
|
||||
{ "controls.scoreboard", L"SHOW SCORES", 2 },
|
||||
{ "controls.pause", L"PAUSE MENU", 2 },
|
||||
{ "controls.screenshot", L"SCREENSHOT", 2 },
|
||||
{ "controls.push_to_talk", L"PUSH TO TALK", 2 },
|
||||
{ "controls.push_to_talk", L"PUSH TO TALK", 3 },
|
||||
{ "controls.chat", L"CHAT", 3 },
|
||||
{ "controls.team_chat", L"TEAM CHAT", 3 },
|
||||
};
|
||||
|
||||
static struct
|
||||
@@ -2752,6 +2755,7 @@ boolean game_engine_running(void);
|
||||
void game_engine_end_game(void);
|
||||
/* the platform layer's */
|
||||
int p2p_join_invite(char const *text);
|
||||
int p2p_join_listing(struct p2p_listing const *listing);
|
||||
int p2p_invite_link(char *link, int size);
|
||||
void p2p_set_hosting_allowed(int allowed);
|
||||
int p2p_peer_address(unsigned char const *identifier, unsigned long *address);
|
||||
@@ -2984,6 +2988,12 @@ static void text_field_show(struct widget_instance *value, char const *text, boo
|
||||
shown[index++] = L'_';
|
||||
shown[index] = 0;
|
||||
text_set(value, shown);
|
||||
/* (what is being typed shown as it is: streamer mode hides nothing of it,
|
||||
text_filter.c) */
|
||||
if (editing && value)
|
||||
text_filter_exempt(value->parameters.text_box.text);
|
||||
else if (!text_field_editing(NULL))
|
||||
text_filter_exempt(NULL);
|
||||
}
|
||||
|
||||
/* ---- the menu */
|
||||
@@ -4208,7 +4218,9 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
lobby_browser_update) */
|
||||
static boolean lobby_browser_join(struct p2p_listing const *game, short controller)
|
||||
{
|
||||
if (!p2p_join_invite(game->invite))
|
||||
/* (a public game: the text chat is off in it, whatever its host says:
|
||||
network_chat.c) */
|
||||
if (!p2p_join_listing(game))
|
||||
return FALSE;
|
||||
csmemcpy(lobby_browser.identifier, game->identifier, sizeof(lobby_browser.identifier));
|
||||
csmemcpy(lobby_browser.name, game->name, sizeof(lobby_browser.name));
|
||||
@@ -5298,6 +5310,8 @@ static struct gametype_option const gametype_options[] =
|
||||
{ "5", "10", "15", "20", "30", "50" } },
|
||||
/* (and the players' votes to kick: port/linux/game/network_votekick.c) */
|
||||
{ "votekick_spinner", _option_setting, 0, 0, 2, { 0 }, "network.votekick", { "true", "false" } },
|
||||
/* (and the text chat: port/linux/game/network_chat.c) */
|
||||
{ "text_chat_spinner", _option_setting, 0, 0, 3, { 0 }, "network.text_chat", { "on", "links", "off" } },
|
||||
/* co-op's options (Server Setup's CO-OP OPTIONS: tools/port_settings.py's
|
||||
COOP_SETUP_SCREENS; coop_enemies.c) */
|
||||
{ "coop_friendly_fire_spinner", _option_setting, 0, 0, 4, { 0 }, "network.coop_friendly_fire",
|
||||
@@ -5313,13 +5327,25 @@ static struct gametype_option const gametype_options[] =
|
||||
/* map sharing's (Server Setup's MAP SHARING: tools/port_settings.py's
|
||||
MAP_SHARE_SETUP; map_share.c) */
|
||||
{ "map_share_spinner", _option_setting, 0, 0, 2, { 0 }, "network.map_share", { "true", "false" } },
|
||||
{ "map_share_upload_spinner", _option_setting, 0, 0, 6, { 0 }, "network.map_share_upload",
|
||||
{ "256", "512", "1024", "2048", "4096", "8192" } },
|
||||
{ "map_share_upload_spinner", _option_setting, 0, 0, 8, { 0 }, "network.map_share_upload",
|
||||
{ "256", "512", "1024", "2048", "4096", "8192", "16384", "20480" } },
|
||||
/* vehicle options (the side's set and counts: vehicles_update) */
|
||||
{ "vehicles_respawn_spinner", _option_short, OPTIONS_FIELD(vehicle_respawn_time), 0, 7,
|
||||
{ 0, 30, 60, 90, 120, 180, 300 } },
|
||||
};
|
||||
|
||||
/* TEXT CHAT's (network.text_chat) OFF, which it shows while the game is
|
||||
listed in the server browser, and its host cannot change: a listed game has
|
||||
no text chat whatever the setting (network_chat.c), which is kept for a
|
||||
private game or a LAN one */
|
||||
#define TEXT_CHAT_SPINNER "text_chat_spinner"
|
||||
#define TEXT_CHAT_OFF 2
|
||||
|
||||
static boolean text_chat_locked(struct gametype_option const *option)
|
||||
{
|
||||
return !strcmp(option->spinner, TEXT_CHAT_SPINNER) && p2p_hosting_listed();
|
||||
}
|
||||
|
||||
/* an option of the host's own setting: the value shown for it (the one
|
||||
set, else the nearest) */
|
||||
static short gametype_option_setting_index(struct gametype_option const *option)
|
||||
@@ -5454,8 +5480,11 @@ static void gametype_options_each(struct widget_instance *list, boolean save)
|
||||
if (!gametype_edit.setup)
|
||||
continue;
|
||||
if (!save)
|
||||
spinner->parameters.list.selected_index = gametype_option_setting_index(option);
|
||||
else if (index != gametype_option_setting_index(option) &&
|
||||
{
|
||||
spinner->parameters.list.selected_index = text_chat_locked(option) ? TEXT_CHAT_OFF :
|
||||
gametype_option_setting_index(option);
|
||||
}
|
||||
else if (!text_chat_locked(option) && index != gametype_option_setting_index(option) &&
|
||||
!setting_write(option->setting, option->setting_values[index]))
|
||||
{
|
||||
platform_log("menus: could not set %s", option->setting);
|
||||
@@ -5495,8 +5524,11 @@ static void setting_options_each(struct widget_instance *list, boolean save)
|
||||
continue;
|
||||
index = (short)PIN(spinner->parameters.list.selected_index, 0, option->count - 1);
|
||||
if (!save)
|
||||
spinner->parameters.list.selected_index = gametype_option_setting_index(option);
|
||||
else if (index != gametype_option_setting_index(option) &&
|
||||
{
|
||||
spinner->parameters.list.selected_index = text_chat_locked(option) ? TEXT_CHAT_OFF :
|
||||
gametype_option_setting_index(option);
|
||||
}
|
||||
else if (!text_chat_locked(option) && index != gametype_option_setting_index(option) &&
|
||||
!setting_write(option->setting, option->setting_values[index]))
|
||||
{
|
||||
platform_log("menus: could not set %s", option->setting);
|
||||
@@ -5837,6 +5869,9 @@ static void gametype_option_help(struct widget_instance *list)
|
||||
visible_set(named(list, "op_primary_weapon", 0), custom);
|
||||
visible_set(named(list, "op_secondary_weapon", 0), custom);
|
||||
}
|
||||
/* (TEXT CHAT held at OFF while the game is listed: text_chat_locked) */
|
||||
if (named(list, TEXT_CHAT_SPINNER, 0) && p2p_hosting_listed())
|
||||
named(list, TEXT_CHAT_SPINNER, 0)->parameters.list.selected_index = TEXT_CHAT_OFF;
|
||||
/* (CO-OP OPTIONS: the row of the amount of the extra enemies chosen,
|
||||
PER PLAYER's or MULTIPLIER's, in the one place) */
|
||||
if (named(list, "coop_extra_enemies_spinner", 0))
|
||||
|
||||
@@ -1767,13 +1767,17 @@ profile itself. */
|
||||
|
||||
#define PAUSE_SETTINGS_LIST "main_menu/settings_select/player_setup/player_profile_edit/profile_edit_select_list"
|
||||
#define PAUSE_SETTINGS_GAMEPADS_OK "main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_ok"
|
||||
#define PAUSE_NETWORK_ITEM "main_menu/settings_select/player_setup/player_profile_edit/network_settings_profile_item"
|
||||
#define PAUSE_NETWORK_SCREEN \
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/network_setup/in_game/in_game_network_settings_screen"
|
||||
|
||||
/* Change Name's keyboard and Change Color's pictures are ui.map's, Network
|
||||
Setup's settings are not for a game under way, and About is nothing to it */
|
||||
Setup is for others' games (shown in co-op: its pages, pause_network_patch),
|
||||
and About is nothing to it */
|
||||
static char const *const pause_settings_hidden_items[] =
|
||||
{
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/name_profile_item",
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/network_settings_profile_item",
|
||||
PAUSE_NETWORK_ITEM,
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/color_profile_item",
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/about_item",
|
||||
};
|
||||
@@ -1906,12 +1910,40 @@ static boolean pause_settings_item_hidden(long tag_index)
|
||||
{
|
||||
long widget = widget_named(pause_settings_hidden_items[index]);
|
||||
|
||||
/* (Network Setup stays in a co-op game, which is a network one or
|
||||
has players beside this one: build.campaign is a game alone) */
|
||||
if (!build.campaign && !strcmp(pause_settings_hidden_items[index], PAUSE_NETWORK_ITEM))
|
||||
continue;
|
||||
if (widget != NONE && build.widget_tags[widget] == tag_index)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* in a game (a multiplayer map's pause menu, a campaign's in co-op),
|
||||
Network Setup opens its pages alone (PAUSE_NETWORK_SCREEN: map sharing, the
|
||||
multiplayer HUD and the text chat, streamer mode: tools/port_settings.py),
|
||||
not the rows that would drop the game (internet play) or are for the main
|
||||
menu (the router, the clipboard, the updates) */
|
||||
static void pause_network_patch(void)
|
||||
{
|
||||
long item_widget = widget_named(PAUSE_NETWORK_ITEM);
|
||||
long screen_widget = widget_named(PAUSE_NETWORK_SCREEN);
|
||||
struct ui_widget_definition *item;
|
||||
struct ui_widget_event_handler_reference *handlers;
|
||||
long handler;
|
||||
|
||||
if (item_widget == NONE || screen_widget == NONE)
|
||||
return;
|
||||
item = tag_get(UI_WIDGET_DEFINITION_TAG, build.widget_tags[item_widget]);
|
||||
handlers = item->event_handlers.address;
|
||||
for (handler = 0; handler < item->event_handlers.count; handler++)
|
||||
{
|
||||
if (TEST_FLAG(handlers[handler].flags, _event_handler_open_widget_bit))
|
||||
reference_set(&handlers[handler].widget_tag, UI_WIDGET_DEFINITION_TAG, build.widget_tags[screen_widget]);
|
||||
}
|
||||
}
|
||||
|
||||
/* the hidden items stay in the list, empty and taking no events (which it
|
||||
passes over), as an item's description is the one at its place in the list;
|
||||
the others move up into the first places */
|
||||
@@ -2181,6 +2213,7 @@ void menu_tags_loaded(
|
||||
pause_patch(instances);
|
||||
if (campaign)
|
||||
pause_campaign_patch(instances);
|
||||
pause_network_patch();
|
||||
if (build.failed)
|
||||
goto failed;
|
||||
/* (those it made) */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
NETWORK_CHAT.H
|
||||
|
||||
The text chat of network games (network_chat.c): what the main loop, the
|
||||
HUD (hud.c, hud_unit.c), the keyboard (xinput_sdl.c) and the netcode ask of
|
||||
it.
|
||||
*/
|
||||
|
||||
#ifndef __NETWORK_CHAT_H
|
||||
#define __NETWORK_CHAT_H
|
||||
#pragma once
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
/* who a line is to */
|
||||
enum
|
||||
{
|
||||
_chat_channel_everyone,
|
||||
_chat_channel_team,
|
||||
/* those riding in the sender's vehicle */
|
||||
_chat_channel_vehicle,
|
||||
NUMBER_OF_CHAT_CHANNELS
|
||||
};
|
||||
|
||||
/* ---------- prototypes/NETWORK_CHAT.C */
|
||||
|
||||
/* every frame (main.c): the keys that start typing a line, and those typed */
|
||||
void network_chat_update(void);
|
||||
/* the first local player says a line to a channel, as if typed and sent;
|
||||
the automated tests' (network_test.c) */
|
||||
void network_chat_say(short channel, char const *text);
|
||||
/* ... sent past this machine's own checks of the host's settings, as a
|
||||
changed build could send it, for the host to refuse (network_test.c) */
|
||||
void network_chat_say_unchecked(short channel, char const *text);
|
||||
/* whether a line is being typed: the keyboard types into it, and drives no
|
||||
player (xinput_sdl.c), as with the console */
|
||||
boolean network_chat_typing(void);
|
||||
/* (hud_unit.c) where the local player's motion sensor was drawn: its left
|
||||
and the top of its circle, in the window's units */
|
||||
void network_chat_note_motion_sensor(short local_player_index, short left, short top);
|
||||
/* (hud.c, in the HUD of each local player's view) the lines that view's
|
||||
player hears, above the motion sensor (with the touch controls, under the
|
||||
weapon's panel at the top left), and in the first local player's the one
|
||||
being typed */
|
||||
void network_chat_draw(short local_player_index);
|
||||
/* (the host) the minutes a player (absolute index) is muted for everyone;
|
||||
0 for none */
|
||||
short network_chat_host_mute_minutes(short player_index);
|
||||
/* (the host: the scoreboard) a player (absolute index) muted for everyone,
|
||||
their lines and their voice, for /mute's minutes when it gives none (every
|
||||
machine told), or unmuted */
|
||||
void network_chat_host_mute(short player_index, boolean mute);
|
||||
/* (the host: network_voice.c) whether a player's name (the network game's,
|
||||
in the lobby too; at most 12 characters, ended or not) is muted for everyone:
|
||||
their machine's voice goes no further */
|
||||
boolean network_chat_host_name_muted(wchar_t const *name);
|
||||
|
||||
#endif // __NETWORK_CHAT_H
|
||||
@@ -4050,6 +4050,9 @@ void network_distributed_handle_message(
|
||||
case _distributed_message_pickups: entry_size = sizeof(struct distributed_pickup); break;
|
||||
case _distributed_message_votekick: entry_size = network_votekick_request_entry_size(); break;
|
||||
case _distributed_message_votekick_status: entry_size = network_votekick_status_entry_size(); break;
|
||||
case _distributed_message_chat_up:
|
||||
case _distributed_message_chat_down: entry_size = network_chat_line_entry_size(); break;
|
||||
case _distributed_message_chat_config: entry_size = network_chat_config_entry_size(); break;
|
||||
case _distributed_message_player_inputs: entry_size = sizeof(struct distributed_player_input); break;
|
||||
case _distributed_message_relayed_actions: entry_size = DISTRIBUTED_RELAYED_ACTION_MINIMUM_SIZE; break;
|
||||
case _distributed_message_game_state:
|
||||
@@ -4076,6 +4079,9 @@ void network_distributed_handle_message(
|
||||
case _distributed_message_coop_skip_vote:
|
||||
case _distributed_message_votekick:
|
||||
case _distributed_message_votekick_status:
|
||||
case _distributed_message_chat_up:
|
||||
case _distributed_message_chat_down:
|
||||
case _distributed_message_chat_config:
|
||||
if (header.count < 1)
|
||||
return;
|
||||
break;
|
||||
@@ -4107,6 +4113,7 @@ void network_distributed_handle_message(
|
||||
case _distributed_message_player_inputs:
|
||||
case _distributed_message_coop_skip_vote:
|
||||
case _distributed_message_votekick:
|
||||
case _distributed_message_chat_up:
|
||||
if (machine_index == NONE || game_connection() != _game_connection_network_server)
|
||||
return;
|
||||
break;
|
||||
@@ -4167,6 +4174,17 @@ void network_distributed_handle_message(
|
||||
case _distributed_message_votekick_status:
|
||||
network_votekick_handle_status(entries);
|
||||
break;
|
||||
case _distributed_message_chat_up:
|
||||
network_chat_handle_up(machine_index, entries, distributed_handling_stream_message);
|
||||
break;
|
||||
/* (the host's, over its connection's stream alone: a datagram from its
|
||||
address could be anyone's) */
|
||||
case _distributed_message_chat_down:
|
||||
network_chat_handle_down(entries, !network_connection_last_read_was_unreliable());
|
||||
break;
|
||||
case _distributed_message_chat_config:
|
||||
network_chat_handle_config(entries, !network_connection_last_read_was_unreliable());
|
||||
break;
|
||||
case _distributed_message_coop_device_groups:
|
||||
network_coop_handle_device_groups(entries, header.count);
|
||||
break;
|
||||
|
||||
@@ -125,6 +125,14 @@ enum
|
||||
_distributed_message_map_share_offer = 84,
|
||||
_distributed_message_map_share_sources = 85,
|
||||
_distributed_message_map_share_progress = 86,
|
||||
/* the text chat (network_chat.c): a player's line to the host,
|
||||
reliably, which takes it only from the player's own machine's stream; and
|
||||
the line the host sends on to each machine that hears it, reliably */
|
||||
_distributed_message_chat_up = 87,
|
||||
_distributed_message_chat_down = 88,
|
||||
/* the host's text chat settings (network_chat.c): whether its players
|
||||
may chat and send links, to every client, reliably */
|
||||
_distributed_message_chat_config = 89,
|
||||
|
||||
/* The VR port's own messages, numbered far past the game's (240 on),
|
||||
so that messages upstream adds never take their numbers: a build
|
||||
@@ -301,6 +309,19 @@ word network_votekick_request_entry_size(void);
|
||||
void network_votekick_handle_status(void const *entries);
|
||||
word network_votekick_status_entry_size(void);
|
||||
|
||||
/* ---------- prototypes/NETWORK_CHAT.C */
|
||||
|
||||
/* (the host) a client's line; from_stream: it came over the machine's own
|
||||
stream (anything else is refused) */
|
||||
void network_chat_handle_up(long machine_index, void const *entries, boolean from_stream);
|
||||
/* (a client) a line the host sent on; from_stream: it came over the host's
|
||||
connection's stream (anything else is refused) */
|
||||
void network_chat_handle_down(void const *entries, boolean from_stream);
|
||||
word network_chat_line_entry_size(void);
|
||||
/* (a client) the host's chat settings; from_stream: as above */
|
||||
void network_chat_handle_config(void const *entries, boolean from_stream);
|
||||
word network_chat_config_entry_size(void);
|
||||
|
||||
/* ---------- prototypes/NETWORK_ACTORS.C */
|
||||
|
||||
void network_actors_new_game(void);
|
||||
|
||||
@@ -41,6 +41,7 @@ Called from the main loop every frame (main.c).
|
||||
#include "cseries.h"
|
||||
#include "main/main.h"
|
||||
#include "interface/player_ui.h"
|
||||
#include "saved games/player_profile.h"
|
||||
#include "interface/ui_widget.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "networking/network_client_manager.h"
|
||||
@@ -61,6 +62,9 @@ Called from the main loop every frame (main.c).
|
||||
#include "camera/observer.h"
|
||||
|
||||
#include "../src/p2p.h" /* port: port/linux/src/p2p.c, p2p_lobby.c */
|
||||
#include "network_chat.h"
|
||||
#include "network_voice.h"
|
||||
#include "halo_keyboard.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
@@ -72,6 +76,7 @@ const char *config_string(char const *name);
|
||||
int config_boolean(char const *name);
|
||||
double config_real(char const *name);
|
||||
long config_integer(char const *name);
|
||||
int config_write(char const *name, char const *value);
|
||||
void platform_log(char const *format, ...);
|
||||
/* damage.c's */
|
||||
void damage_kill_object_for_player(long object_index, long player_index);
|
||||
@@ -81,6 +86,7 @@ void network_distributed_item_statistics(long *creates, long *deletes, long *fai
|
||||
void network_damage_statistics(long *sent_reports, long *dealt_reports, long *rejected_reports, long *replayed_events);
|
||||
/* xinput_sdl.c's */
|
||||
void test_input_hold_action(int hold);
|
||||
void test_input_press(unsigned long buttons);
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -116,6 +122,9 @@ static struct
|
||||
real vehicle_time;
|
||||
real pickup_time;
|
||||
char pickup_weapon[64];
|
||||
/* debug.network_test_chat's, and the lines said this game */
|
||||
real chat_time;
|
||||
short chat_lines_said;
|
||||
long score_to_win;
|
||||
long logged_time;
|
||||
boolean public_game;
|
||||
@@ -183,6 +192,7 @@ static void network_test_read_settings(
|
||||
network_test.shoot_interval = (real)config_real("debug.network_test_shoot");
|
||||
network_test.vehicle_time = (real)config_real("debug.network_test_vehicle");
|
||||
network_test.pickup_time = (real)config_real("debug.network_test_pickup");
|
||||
network_test.chat_time = (real)config_real("debug.network_test_chat");
|
||||
snprintf(network_test.pickup_weapon, sizeof(network_test.pickup_weapon), "%s",
|
||||
config_string("debug.network_test_pickup_weapon"));
|
||||
network_test.score_to_win = (long)config_integer("debug.network_test_score");
|
||||
@@ -591,6 +601,193 @@ static void network_test_vehicle(
|
||||
}
|
||||
}
|
||||
|
||||
/* debug.network_test_name: the name the machine's first player takes (its
|
||||
profile's, which it joins with), in ASCII */
|
||||
static void network_test_set_name(
|
||||
void)
|
||||
{
|
||||
char const *name = config_string("debug.network_test_name");
|
||||
struct player_profile profile;
|
||||
short index;
|
||||
|
||||
if (!name || !name[0])
|
||||
return;
|
||||
player_ui_get_active_player_profile(0, &profile);
|
||||
for (index = 0; name[index] && index < MAXIMUM_PLAYER_PROFILE_NAME_LENGTH - 1; index++)
|
||||
profile.player_name[index] = (wchar_t)(unsigned char)name[index];
|
||||
profile.player_name[index] = 0;
|
||||
player_ui_set_active_player_profile(0, player_ui_get_active_player_profile_index(0), &profile);
|
||||
platform_log("network test: this machine's player is named %s", name);
|
||||
}
|
||||
|
||||
/* debug.network_test_chat: the host seats the last two players in one
|
||||
vehicle, the nearest to the first of them with seats for both (any, a map's
|
||||
own), for the vehicle chat (two joining machines' players, of one team: they
|
||||
start near each other) */
|
||||
static void network_test_seat_together(
|
||||
void)
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
struct object_iterator vehicles;
|
||||
long units[2];
|
||||
long best_index = NONE;
|
||||
real best_distance = 0.0f;
|
||||
short count = 0;
|
||||
short index;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = (struct player_datum *)data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
if (player->unit_index == NONE)
|
||||
continue;
|
||||
units[0] = count ? units[1] : NONE;
|
||||
units[1] = player->unit_index;
|
||||
count++;
|
||||
}
|
||||
if (count < 2)
|
||||
return;
|
||||
object_iterator_new(&vehicles, _object_mask_vehicle, 0);
|
||||
while (object_iterator_next(&vehicles))
|
||||
{
|
||||
real distance;
|
||||
|
||||
if (unit_definition_get(object_get(vehicles.index)->definition_index)->unit.seats.count < 2)
|
||||
continue;
|
||||
distance = distance_squared3d(&object_get(units[0])->object.position, &object_get(vehicles.index)->object.position);
|
||||
if (best_index == NONE || distance < best_distance)
|
||||
{
|
||||
best_index = vehicles.index;
|
||||
best_distance = distance;
|
||||
}
|
||||
}
|
||||
if (best_index == NONE)
|
||||
{
|
||||
platform_log("network test: no vehicle with two seats");
|
||||
return;
|
||||
}
|
||||
for (index = 0; index < (short)NUMBEROF(units); index++)
|
||||
{
|
||||
short seat_index;
|
||||
|
||||
for (seat_index = 0;
|
||||
seat_index < unit_definition_get(object_get(best_index)->definition_index)->unit.seats.count; seat_index++)
|
||||
{
|
||||
if (!unit_seat_filled(best_index, seat_index) && unit_enter_seat(units[index], best_index, seat_index))
|
||||
break;
|
||||
}
|
||||
}
|
||||
platform_log("network test: the last two players ride vehicle %lx: %s, %s", best_index,
|
||||
object_get(units[0])->object.parent_object_index == best_index ? "in" : "out",
|
||||
object_get(units[1])->object.parent_object_index == best_index ? "in" : "out");
|
||||
}
|
||||
|
||||
/* debug.network_test_chat: a line typed on the text chat's on-screen
|
||||
keyboard with the controller's buttons, ticks since it began: each held
|
||||
for two frames and let go for two, whatever the frame rate (a press of two
|
||||
ticks falls between two frames of a machine drawing slowly) (the keyboard
|
||||
opens on the first key, 'q': "gg ez", then D-pad Down to the team, then
|
||||
Start) */
|
||||
static void network_test_keyboard_line(
|
||||
long ticks)
|
||||
{
|
||||
enum { STEP_FRAMES = 4 };
|
||||
static long frames;
|
||||
static long last_ticks = -1;
|
||||
static unsigned long const steps[] =
|
||||
{
|
||||
1UL << HALO_CHAT_PAD_UP,
|
||||
1UL << HALO_CHAT_PAD_STICK_DOWN,
|
||||
1UL << HALO_CHAT_PAD_STICK_RIGHT, 1UL << HALO_CHAT_PAD_STICK_RIGHT, 1UL << HALO_CHAT_PAD_STICK_RIGHT,
|
||||
1UL << HALO_CHAT_PAD_STICK_RIGHT,
|
||||
1UL << HALO_CHAT_PAD_A, 1UL << HALO_CHAT_PAD_A,
|
||||
1UL << HALO_CHAT_PAD_STICK_DOWN, 1UL << HALO_CHAT_PAD_STICK_DOWN,
|
||||
1UL << HALO_CHAT_PAD_A,
|
||||
1UL << HALO_CHAT_PAD_STICK_UP, 1UL << HALO_CHAT_PAD_STICK_UP, 1UL << HALO_CHAT_PAD_STICK_UP,
|
||||
1UL << HALO_CHAT_PAD_STICK_LEFT, 1UL << HALO_CHAT_PAD_STICK_LEFT,
|
||||
1UL << HALO_CHAT_PAD_A,
|
||||
1UL << HALO_CHAT_PAD_STICK_DOWN, 1UL << HALO_CHAT_PAD_STICK_DOWN,
|
||||
1UL << HALO_CHAT_PAD_STICK_LEFT, 1UL << HALO_CHAT_PAD_STICK_LEFT,
|
||||
1UL << HALO_CHAT_PAD_A,
|
||||
1UL << HALO_CHAT_PAD_DOWN,
|
||||
1UL << HALO_CHAT_PAD_START,
|
||||
};
|
||||
long step;
|
||||
|
||||
/* (frames since it began: again for the next game's line) */
|
||||
if (ticks < last_ticks)
|
||||
frames = 0;
|
||||
last_ticks = ticks;
|
||||
step = frames / STEP_FRAMES;
|
||||
frames++;
|
||||
if (step >= (long)NUMBEROF(steps))
|
||||
{
|
||||
/* (after the line, let go: a held key would move nothing more) */
|
||||
if (step == (long)NUMBEROF(steps))
|
||||
test_input_press(0);
|
||||
return;
|
||||
}
|
||||
test_input_press((frames - 1) % STEP_FRAMES < STEP_FRAMES / 2 ? steps[step] : 0);
|
||||
}
|
||||
|
||||
/* debug.network_test_chat: the last player (absolute index; NONE), whom the
|
||||
host mutes; whether it is this machine's; and the first player's machine
|
||||
(the network's index: the host's), which the last player's mutes */
|
||||
static short network_test_last_player_index(
|
||||
void)
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
short last = NONE;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while (data_iterator_next(&iterator) != NULL)
|
||||
last = (short)DATUM_INDEX_TO_ABSOLUTE_INDEX(iterator.datum_index);
|
||||
return last;
|
||||
}
|
||||
|
||||
static boolean network_test_last_player_local(
|
||||
void)
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
struct player_datum *last = NULL;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = (struct player_datum *)data_iterator_next(&iterator)) != NULL)
|
||||
last = player;
|
||||
return last && last->local_player_index != NONE;
|
||||
}
|
||||
|
||||
static long network_test_first_player_machine(
|
||||
void)
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
player = (struct player_datum *)data_iterator_next(&iterator);
|
||||
return player ? player->network_player_data.machine_index : NONE;
|
||||
}
|
||||
|
||||
/* debug.network_test_chat: the last player's name, in ASCII (the host
|
||||
mutes it) */
|
||||
static void network_test_last_player_name(
|
||||
char *name,
|
||||
short size)
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
struct player_datum *last = NULL;
|
||||
short index;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = (struct player_datum *)data_iterator_next(&iterator)) != NULL)
|
||||
last = player;
|
||||
for (index = 0; last && index < size - 1 && index < (short)NUMBEROF(last->name) && last->name[index]; index++)
|
||||
name[index] = player_name_character_ascii(last->name[index]);
|
||||
name[index] = 0;
|
||||
}
|
||||
|
||||
/* both machines stand the last player at the driver's entrance of the
|
||||
nearest vehicle no one rides (a joining machine's player then holds the
|
||||
action button, as a player getting in does) */
|
||||
@@ -749,6 +946,16 @@ void network_test_update(
|
||||
if (network_test.mode == _network_test_off)
|
||||
return;
|
||||
|
||||
/* debug.network_test_chat: each client's player types "gg ez" on the
|
||||
text chat's on-screen keyboard 32 seconds on, as a controller does, and
|
||||
sends it to the team (each frame, not each second, as the rest) */
|
||||
if (network_test.chat_time > 0.0f && network_test.mode != _network_test_host && game_in_progress() &&
|
||||
!main_menu_loaded &&
|
||||
game_time_get() >= (long)(network_test.chat_time * TICKS_PER_SECOND) + 32 * TICKS_PER_SECOND)
|
||||
{
|
||||
network_test_keyboard_line(game_time_get() - (long)(network_test.chat_time * TICKS_PER_SECOND) -
|
||||
32 * TICKS_PER_SECOND);
|
||||
}
|
||||
/* the game running: report (from the start of each game: the next
|
||||
game's time starts over) */
|
||||
if (game_in_progress() && game_time_get() < network_test.logged_time)
|
||||
@@ -797,6 +1004,151 @@ void network_test_update(
|
||||
test_input_hold_action(hold);
|
||||
}
|
||||
}
|
||||
/* debug.network_test_chat: each machine's player says a line to
|
||||
everyone that many seconds in, one to the team two seconds on, and
|
||||
one to the vehicle two more on, the host having seated the last two
|
||||
players in one vehicle (the others in none) three seconds before;
|
||||
then the host mutes the last player for a minute (a client's /mute
|
||||
of the host refused), each says a line to everyone (the last
|
||||
player's going no further than the host), the host unmutes it, and
|
||||
each says another; then each says a line with a link (refused, as
|
||||
network.text_chat "on" refuses links), the host turns the text chat
|
||||
off (network.text_chat "off"), and each says a line (refused); then
|
||||
the host mutes the last player for everyone, as its scoreboard does,
|
||||
and each says a line, and the last player's machine mutes the host's
|
||||
for itself, as a client's scoreboard does, and each says another */
|
||||
if (network_test.chat_time > 0.0f)
|
||||
{
|
||||
long chat_time = (long)(network_test.chat_time * TICKS_PER_SECOND);
|
||||
char const *machine = network_test.mode == _network_test_host ? "the host" : "a client";
|
||||
char text[64];
|
||||
|
||||
if (game_time_get() < chat_time - 3 * TICKS_PER_SECOND)
|
||||
network_test.chat_lines_said = 0;
|
||||
if (network_test.mode == _network_test_host && network_test.chat_lines_said == 0 &&
|
||||
game_time_get() >= chat_time - 3 * TICKS_PER_SECOND)
|
||||
{
|
||||
network_test_seat_together();
|
||||
network_test.chat_lines_said = -1;
|
||||
}
|
||||
if (network_test.chat_lines_said <= 0 && game_time_get() >= chat_time)
|
||||
{
|
||||
/* (long enough to wrap in the chat's column) */
|
||||
snprintf(text, sizeof(text), "hello everyone from %s, long enough to wrap the column", machine);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said = 1;
|
||||
}
|
||||
if (network_test.chat_lines_said == 1 && game_time_get() >= chat_time + 2 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "hello team from %s", machine);
|
||||
network_chat_say(_chat_channel_team, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 2 && game_time_get() >= chat_time + 4 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "hello vehicle from %s", machine);
|
||||
network_chat_say(_chat_channel_vehicle, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 3 && game_time_get() >= chat_time + 6 * TICKS_PER_SECOND)
|
||||
{
|
||||
char name[16];
|
||||
|
||||
network_test_last_player_name(name, sizeof(name));
|
||||
if (network_test.mode == _network_test_host)
|
||||
snprintf(text, sizeof(text), "/mute %s 1", name);
|
||||
else
|
||||
snprintf(text, sizeof(text), "/mute host");
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 4 && game_time_get() >= chat_time + 8 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "while muted from %s", machine);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 5 && game_time_get() >= chat_time + 10 * TICKS_PER_SECOND)
|
||||
{
|
||||
char name[16];
|
||||
|
||||
network_test_last_player_name(name, sizeof(name));
|
||||
if (network_test.mode == _network_test_host)
|
||||
{
|
||||
snprintf(text, sizeof(text), "/unmute %s", name);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
}
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 6 && game_time_get() >= chat_time + 12 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "after unmute from %s", machine);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 7 && game_time_get() >= chat_time + 14 * TICKS_PER_SECOND)
|
||||
{
|
||||
/* (a client's sent past its own check, for the host to refuse) */
|
||||
snprintf(text, sizeof(text), "join us at discord(dot)gg/halo from %s", machine);
|
||||
if (network_test.mode == _network_test_host)
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
else
|
||||
network_chat_say_unchecked(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 8 && game_time_get() >= chat_time + 16 * TICKS_PER_SECOND)
|
||||
{
|
||||
if (network_test.mode == _network_test_host && !config_write("network.text_chat", "off"))
|
||||
platform_log("network test: could not turn the text chat off");
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 9 && game_time_get() >= chat_time + 18 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "with the chat off from %s", machine);
|
||||
if (network_test.mode == _network_test_host)
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
else
|
||||
network_chat_say_unchecked(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
/* (and on again: config.toml is the executable's folder's, which
|
||||
every test of it shares) */
|
||||
if (network_test.chat_lines_said == 10 && game_time_get() >= chat_time + 20 * TICKS_PER_SECOND)
|
||||
{
|
||||
if (network_test.mode == _network_test_host && !config_write("network.text_chat", "on"))
|
||||
platform_log("network test: could not turn the text chat on");
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
/* (the scoreboard's mutes: the host's of the last player for
|
||||
everyone, their lines and voice, then the last player's machine's
|
||||
own mute of the host's machine, here alone) */
|
||||
if (network_test.chat_lines_said == 11 && game_time_get() >= chat_time + 22 * TICKS_PER_SECOND)
|
||||
{
|
||||
if (network_test.mode == _network_test_host)
|
||||
network_chat_host_mute(network_test_last_player_index(), TRUE);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 12 && game_time_get() >= chat_time + 24 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "after the scoreboard mute from %s", machine);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 13 && game_time_get() >= chat_time + 28 * TICKS_PER_SECOND)
|
||||
{
|
||||
if (network_test.mode == _network_test_host)
|
||||
network_chat_host_mute(network_test_last_player_index(), FALSE);
|
||||
else if (network_test_last_player_local())
|
||||
network_voice_mute_machine(network_test_first_player_machine(), TRUE);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
if (network_test.chat_lines_said == 14 && game_time_get() >= chat_time + 30 * TICKS_PER_SECOND)
|
||||
{
|
||||
snprintf(text, sizeof(text), "after the local mute from %s", machine);
|
||||
network_chat_say(_chat_channel_everyone, text);
|
||||
network_test.chat_lines_said++;
|
||||
}
|
||||
}
|
||||
if (network_test.mode == _network_test_host && network_test.vehicle_time > 0.0f)
|
||||
{
|
||||
long enter_time = (long)(network_test.vehicle_time * TICKS_PER_SECOND);
|
||||
@@ -972,7 +1324,7 @@ void network_test_update(
|
||||
listed[index].invite[0] ? "" : ", locked");
|
||||
}
|
||||
}
|
||||
if (count > 0 && p2p_join_invite(games[0].invite))
|
||||
if (count > 0 && p2p_join_listing(&games[0]))
|
||||
{
|
||||
p2p_lobby_browse(FALSE);
|
||||
platform_log("network test: joining %s's game (%s) from the server browser", games[0].name, games[0].map);
|
||||
@@ -1032,7 +1384,10 @@ void network_test_update(
|
||||
network_test.map_set = TRUE;
|
||||
}
|
||||
if (!network_test.player_added && network_test.setup_seconds >= 2.0f && global_network_game_client_get())
|
||||
{
|
||||
network_test_set_name();
|
||||
network_test.player_added = network_game_client_add_player(global_network_game_client_get(), 0);
|
||||
}
|
||||
if (network_test.setup_seconds >= network_test.start_delay)
|
||||
{
|
||||
network_test.started = TRUE;
|
||||
@@ -1047,6 +1402,7 @@ void network_test_update(
|
||||
network_test.set_up = TRUE;
|
||||
dispose_global_network_game_client();
|
||||
dispose_global_network_game_server();
|
||||
network_test_set_name();
|
||||
if (create_global_network_game_client())
|
||||
{
|
||||
game_connection_set(_game_connection_network_client);
|
||||
|
||||
@@ -30,7 +30,10 @@ decodes, and a machine's own voice never comes back to it.
|
||||
Each machine decides only for itself: whether it talks (audio.voice_chat:
|
||||
push to talk, open mic, or not), how loud the others are
|
||||
(audio.voice_volume), and whom it mutes (the scoreboard's menu,
|
||||
game_engine.c), which it does not tell anyone.
|
||||
game_engine.c: their voice and their text chat lines), which it does not
|
||||
tell anyone. The host's mute for everyone (the scoreboard's, or the chat's
|
||||
/mute: network_chat.c) is the host's alone: it relays none of a muted
|
||||
player's voice.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
@@ -52,6 +55,7 @@ game_engine.c), which it does not tell anyone.
|
||||
#include "objects/objects.h"
|
||||
#include "network_distributed.h"
|
||||
#include "network_voice.h"
|
||||
#include "network_chat.h"
|
||||
#include "../src/voice_audio.h"
|
||||
|
||||
#include <math.h>
|
||||
@@ -375,6 +379,27 @@ static void voice_machine_name(
|
||||
}
|
||||
}
|
||||
|
||||
/* (the host) whether a machine has a player the host muted for everyone
|
||||
(network_chat.c), by the network game's names, which the lobby has too */
|
||||
static boolean voice_machine_muted_for_everyone(
|
||||
long machine_index)
|
||||
{
|
||||
struct network_game *game = voice_network_game();
|
||||
short index;
|
||||
|
||||
for (index = 0; game && index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
{
|
||||
struct network_player *player = &game->players[index];
|
||||
|
||||
if (network_player_is_valid(player) && player->machine_index == machine_index &&
|
||||
network_chat_host_name_muted(player->name))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* a player's living unit's position */
|
||||
static boolean voice_player_position(
|
||||
struct player_datum const *player,
|
||||
@@ -608,6 +633,9 @@ static void voice_host_relay(
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* (a player the host muted for everyone is heard by no one) */
|
||||
if (voice_machine_muted_for_everyone(speaker_machine))
|
||||
return;
|
||||
/* (no more than so many at once: those talking keep talking) */
|
||||
if (!(voice_machines[speaker_machine].talked && now - voice_machines[speaker_machine].talked_at < VOICE_TALKING_MS) &&
|
||||
voice_host_talkers(speaker_machine, now) >= VOICE_MAXIMUM_TALKERS)
|
||||
@@ -924,7 +952,7 @@ void network_voice_update(
|
||||
}
|
||||
/* the microphone: open mic, open while voice is on; push to talk, from
|
||||
the first press (none asked for until then) */
|
||||
held = push_to_talk && halo_push_to_talk_held() && !console_is_active();
|
||||
held = push_to_talk && halo_push_to_talk_held() && !console_is_active() && !network_chat_typing();
|
||||
if (!voice_may_talk() || (!open_mic && !push_to_talk))
|
||||
voice_microphone_wanted = FALSE;
|
||||
else if (open_mic || held)
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
TEXT_FILTER.C
|
||||
|
||||
Streamer mode (Settings > Network Setup > Streamer Mode): the words of
|
||||
text_filter_match.c's list hidden as stars wherever text is drawn, at the
|
||||
levels set (streamer.enabled, and streamer.slurs, streamer.swearing and
|
||||
streamer.insults: "off", "severe", "strong" or "mild", each that severity
|
||||
and worse).
|
||||
|
||||
draw_string.c's draw_string and draw_unicode_string take the string's
|
||||
filtered copy before they draw or measure it (draw_string_compute_bounds
|
||||
and the rest measure through them), so every string the game shows is
|
||||
filtered: names over heads, the kill feed, the scoreboards, the lobbies, the
|
||||
server browser, map and mod names, the console's lines, and a map's or mod's
|
||||
own text. A copy is the same length or shorter (a censored character is one
|
||||
'*'), so a fixed buffer is never overrun. Copies are kept, so that a string
|
||||
drawn each frame is looked at once.
|
||||
|
||||
What the player types is drawn as it is: the menus' text field being edited
|
||||
(text_filter_exempt), the console's input line and the virtual keyboard's
|
||||
(text_filter_suspend). The player's own words: d:\text_filter.txt, lines of
|
||||
"add <word>" (hidden whenever streamer mode is on) and "allow <word>" (never
|
||||
hidden), read as the settings change.
|
||||
|
||||
Only what this machine draws changes: nothing sent between machines.
|
||||
*/
|
||||
|
||||
#include "text_filter.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* port/linux/src/port_config.c */
|
||||
int config_boolean(const char *name);
|
||||
const char *config_string(const char *name);
|
||||
unsigned long config_changes(void);
|
||||
|
||||
#define USER_FILE "d:\\text_filter.txt"
|
||||
#define CACHE_ENTRIES 128
|
||||
#define CACHE_LENGTH 256
|
||||
#define LONG_BUFFERS 4
|
||||
|
||||
struct text_filter_cache_entry
|
||||
{
|
||||
unsigned long hash;
|
||||
short length;
|
||||
unsigned char narrow;
|
||||
unsigned char clean;
|
||||
unsigned short original[CACHE_LENGTH];
|
||||
union
|
||||
{
|
||||
unsigned short wide[CACHE_LENGTH];
|
||||
char narrow[CACHE_LENGTH];
|
||||
} filtered;
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
unsigned long changes;
|
||||
int enabled;
|
||||
unsigned char levels[NUMBER_OF_TEXT_FILTER_GROUPS];
|
||||
long suspended;
|
||||
void const *exempt;
|
||||
struct text_filter_cache_entry cache[CACHE_ENTRIES];
|
||||
union
|
||||
{
|
||||
unsigned short wide[TEXT_FILTER_MAXIMUM_LENGTH + 1];
|
||||
char narrow[TEXT_FILTER_MAXIMUM_LENGTH + 1];
|
||||
} long_buffers[LONG_BUFFERS];
|
||||
long next_long_buffer;
|
||||
unsigned short units[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
unsigned char censored[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
} text_filter_globals = { (unsigned long)-1 };
|
||||
|
||||
static unsigned char text_filter_level(
|
||||
char const *name)
|
||||
{
|
||||
char const *value = config_string(name);
|
||||
|
||||
if (!value || !strcmp(value, "off"))
|
||||
return _text_filter_off;
|
||||
if (!strcmp(value, "severe"))
|
||||
return _text_filter_severe;
|
||||
if (!strcmp(value, "strong"))
|
||||
return _text_filter_strong;
|
||||
return _text_filter_mild;
|
||||
}
|
||||
|
||||
/* the list again with the player's own words (USER_FILE) */
|
||||
static void text_filter_user_words(
|
||||
void)
|
||||
{
|
||||
FILE *file = fopen(USER_FILE, "r");
|
||||
char line[128];
|
||||
|
||||
text_filter_words_reset();
|
||||
if (!file)
|
||||
return;
|
||||
while (fgets(line, sizeof(line), file))
|
||||
{
|
||||
char *word = line;
|
||||
|
||||
line[strcspn(line, "\r\n")] = 0;
|
||||
while (*word == ' ' || *word == '\t')
|
||||
word++;
|
||||
if (!strncmp(word, "add ", 4))
|
||||
text_filter_word_add(word + 4, _text_filter_own, _text_filter_severe, _text_filter_anywhere);
|
||||
else if (!strncmp(word, "allow ", 6))
|
||||
text_filter_allow_add(word + 6);
|
||||
}
|
||||
fclose(file);
|
||||
return;
|
||||
}
|
||||
|
||||
/* whether anything is hidden: the settings, read again when they change */
|
||||
static int text_filter_enabled(
|
||||
void)
|
||||
{
|
||||
if (text_filter_globals.changes != config_changes())
|
||||
{
|
||||
long index;
|
||||
|
||||
text_filter_globals.changes = config_changes();
|
||||
text_filter_globals.enabled = config_boolean("streamer.enabled") != 0;
|
||||
text_filter_globals.levels[_text_filter_slurs] = text_filter_level("streamer.slurs");
|
||||
text_filter_globals.levels[_text_filter_swearing] = text_filter_level("streamer.swearing");
|
||||
text_filter_globals.levels[_text_filter_insults] = text_filter_level("streamer.insults");
|
||||
text_filter_globals.levels[_text_filter_own] = _text_filter_mild;
|
||||
for (index = 0; index < CACHE_ENTRIES; index++)
|
||||
text_filter_globals.cache[index].length = -1;
|
||||
if (text_filter_globals.enabled)
|
||||
text_filter_user_words();
|
||||
}
|
||||
return text_filter_globals.enabled && !text_filter_globals.suspended;
|
||||
}
|
||||
|
||||
/* whether the string is a copy of ours (a string measured is drawn again
|
||||
through draw_string or draw_unicode_string) */
|
||||
static int text_filter_ours(
|
||||
void const *string)
|
||||
{
|
||||
char const *pointer = (char const *)string;
|
||||
char const *start = (char const *)&text_filter_globals;
|
||||
|
||||
return pointer >= start && pointer < start + sizeof(text_filter_globals);
|
||||
}
|
||||
|
||||
static unsigned long text_filter_hash(
|
||||
unsigned short const *units,
|
||||
long length)
|
||||
{
|
||||
unsigned long hash = 2166136261UL;
|
||||
long index;
|
||||
|
||||
for (index = 0; index < length; index++)
|
||||
hash = (hash ^ units[index]) * 16777619UL;
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* the units with what is hidden as '*' (a wide string's "|n" and a narrow
|
||||
string's style codes kept, and a wide "|"'s hidden character dropped with
|
||||
it), into wide or narrow; whether anything was */
|
||||
static int text_filter_apply(
|
||||
unsigned short const *units,
|
||||
long length,
|
||||
int narrow,
|
||||
unsigned short *wide,
|
||||
char *narrow_text)
|
||||
{
|
||||
unsigned char *censored = text_filter_globals.censored;
|
||||
long index;
|
||||
long written = 0;
|
||||
|
||||
if (!text_filter_censor(units, length, narrow, text_filter_globals.levels, censored))
|
||||
return 0;
|
||||
for (index = 0; index < length; index++)
|
||||
{
|
||||
unsigned short unit = units[index];
|
||||
|
||||
if (censored[index])
|
||||
{
|
||||
if (unit == '|' && index + 1 < length)
|
||||
{
|
||||
unsigned short next = units[index + 1];
|
||||
|
||||
if (next == 'n' || (narrow && next && next < 0x80 && strchr("ibukprlctn", (char)next)))
|
||||
{
|
||||
/* a line break or a style code: kept */
|
||||
if (narrow)
|
||||
{
|
||||
narrow_text[written++] = '|';
|
||||
narrow_text[written++] = (char)next;
|
||||
}
|
||||
else
|
||||
{
|
||||
wide[written++] = '|';
|
||||
wide[written++] = next;
|
||||
}
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
if (!narrow)
|
||||
{
|
||||
/* a "|" that hides the character after it: both one '*' */
|
||||
index++;
|
||||
}
|
||||
unit = '*';
|
||||
}
|
||||
else if (unit != '\r' && unit != '\n' && unit != '\t')
|
||||
{
|
||||
unit = '*';
|
||||
}
|
||||
}
|
||||
if (narrow)
|
||||
narrow_text[written++] = (char)unit;
|
||||
else
|
||||
wide[written++] = unit;
|
||||
}
|
||||
if (narrow)
|
||||
narrow_text[written] = 0;
|
||||
else
|
||||
wide[written] = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the string's filtered copy, or the string itself (nothing hidden, or a
|
||||
string longer than TEXT_FILTER_MAXIMUM_LENGTH, which is drawn as it is) */
|
||||
static void const *text_filter(
|
||||
void const *string,
|
||||
int narrow)
|
||||
{
|
||||
unsigned short *units = text_filter_globals.units;
|
||||
struct text_filter_cache_entry *entry;
|
||||
unsigned long hash;
|
||||
long length = 0;
|
||||
|
||||
if (!string || string == text_filter_globals.exempt || text_filter_ours(string) || !text_filter_enabled())
|
||||
return string;
|
||||
if (narrow)
|
||||
{
|
||||
unsigned char const *text = (unsigned char const *)string;
|
||||
|
||||
while (text[length] && length <= TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
{
|
||||
if (length < TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
units[length] = text[length];
|
||||
length++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short const *text = (unsigned short const *)string;
|
||||
|
||||
while (text[length] && length <= TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
{
|
||||
if (length < TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
units[length] = text[length];
|
||||
length++;
|
||||
}
|
||||
}
|
||||
if (!length || length > TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
return string;
|
||||
if (length >= CACHE_LENGTH)
|
||||
{
|
||||
/* a long string: filtered each time it is drawn, into one of a few
|
||||
buffers in turn */
|
||||
long buffer = text_filter_globals.next_long_buffer;
|
||||
|
||||
text_filter_globals.next_long_buffer = (buffer + 1) % LONG_BUFFERS;
|
||||
if (!text_filter_apply(units, length, narrow, text_filter_globals.long_buffers[buffer].wide,
|
||||
text_filter_globals.long_buffers[buffer].narrow))
|
||||
{
|
||||
return string;
|
||||
}
|
||||
return narrow ?
|
||||
(void const *)text_filter_globals.long_buffers[buffer].narrow :
|
||||
(void const *)text_filter_globals.long_buffers[buffer].wide;
|
||||
}
|
||||
hash = text_filter_hash(units, length) ^ (unsigned long)narrow;
|
||||
entry = &text_filter_globals.cache[hash % CACHE_ENTRIES];
|
||||
if (entry->length != length || entry->hash != hash || entry->narrow != narrow ||
|
||||
memcmp(entry->original, units, length * sizeof(*units)))
|
||||
{
|
||||
entry->hash = hash;
|
||||
entry->length = (short)length;
|
||||
entry->narrow = (unsigned char)narrow;
|
||||
memcpy(entry->original, units, length * sizeof(*units));
|
||||
entry->clean = !text_filter_apply(units, length, narrow, entry->filtered.wide, entry->filtered.narrow);
|
||||
}
|
||||
if (entry->clean)
|
||||
return string;
|
||||
return narrow ? (void const *)entry->filtered.narrow : (void const *)entry->filtered.wide;
|
||||
}
|
||||
|
||||
/* draw_unicode_string's string (draw_string.c) */
|
||||
wchar_t const *text_filter_unicode(
|
||||
wchar_t const *string)
|
||||
{
|
||||
return (wchar_t const *)text_filter(string, 0);
|
||||
}
|
||||
|
||||
/* draw_string's string (draw_string.c) */
|
||||
char const *text_filter_string(
|
||||
char const *string)
|
||||
{
|
||||
return (char const *)text_filter(string, 1);
|
||||
}
|
||||
|
||||
/* what is drawn until text_filter_resume drawn as it is (what the player
|
||||
types) */
|
||||
void text_filter_suspend(
|
||||
void)
|
||||
{
|
||||
text_filter_globals.suspended++;
|
||||
return;
|
||||
}
|
||||
|
||||
void text_filter_resume(
|
||||
void)
|
||||
{
|
||||
if (text_filter_globals.suspended > 0)
|
||||
text_filter_globals.suspended--;
|
||||
return;
|
||||
}
|
||||
|
||||
/* the text (a widget's buffer) drawn as it is while it is being edited;
|
||||
NULL: none */
|
||||
void text_filter_exempt(
|
||||
void const *text)
|
||||
{
|
||||
text_filter_globals.exempt = text;
|
||||
return;
|
||||
}
|
||||
|
||||
/* text shown outside the game's drawing (the platform's message boxes),
|
||||
UTF-8, filtered in place (a hidden character, of however many bytes, one
|
||||
'*') */
|
||||
void text_filter_utf8(
|
||||
char *text)
|
||||
{
|
||||
unsigned short *units = text_filter_globals.units;
|
||||
unsigned char *censored = text_filter_globals.censored;
|
||||
long starts[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
unsigned char const *byte = (unsigned char const *)text;
|
||||
long length = 0;
|
||||
long index;
|
||||
long written = 0;
|
||||
long read = 0;
|
||||
long total;
|
||||
|
||||
if (!text || !text_filter_enabled())
|
||||
return;
|
||||
while (*byte && length < TEXT_FILTER_MAXIMUM_LENGTH)
|
||||
{
|
||||
unsigned long code = *byte;
|
||||
long size = 1;
|
||||
|
||||
if (code >= 0xE0 && byte[1] && byte[2])
|
||||
{
|
||||
code = ((code & 0x0F) << 12) | ((byte[1] & 0x3F) << 6) | (byte[2] & 0x3F);
|
||||
size = 3;
|
||||
}
|
||||
else if (code >= 0xC0 && byte[1])
|
||||
{
|
||||
code = ((code & 0x1F) << 6) | (byte[1] & 0x3F);
|
||||
size = 2;
|
||||
}
|
||||
starts[length] = (long)(byte - (unsigned char const *)text);
|
||||
units[length++] = (unsigned short)code;
|
||||
byte += size;
|
||||
}
|
||||
if (*byte || !text_filter_censor(units, length, 0, text_filter_globals.levels, censored))
|
||||
return;
|
||||
total = (long)(byte - (unsigned char const *)text);
|
||||
for (index = 0; index < length; index++)
|
||||
{
|
||||
long next = index + 1 < length ? starts[index + 1] : total;
|
||||
|
||||
read = starts[index];
|
||||
if (censored[index])
|
||||
{
|
||||
text[written++] = '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
while (read < next)
|
||||
text[written++] = text[read++];
|
||||
}
|
||||
}
|
||||
text[written] = 0;
|
||||
return;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
TEXT_FILTER.H
|
||||
|
||||
Streamer mode (Settings > Network Setup > Streamer Mode, streamer.*): the
|
||||
words hidden as stars in what is drawn. text_filter_match.c finds them, with
|
||||
no game types, so that the harness builds it alone
|
||||
(tools/harness/tests/test_text_filter.py); text_filter.c applies them to
|
||||
what the game draws.
|
||||
*/
|
||||
|
||||
#ifndef __TEXT_FILTER_H__
|
||||
#define __TEXT_FILTER_H__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/* the groups a player sets a level for, and the player's own words
|
||||
(text_filter.txt), hidden whenever streamer mode is on */
|
||||
enum text_filter_group
|
||||
{
|
||||
_text_filter_slurs,
|
||||
_text_filter_swearing,
|
||||
_text_filter_insults,
|
||||
_text_filter_own,
|
||||
NUMBER_OF_TEXT_FILTER_GROUPS
|
||||
};
|
||||
|
||||
/* a term's severity (Surge AI's: mild, strong, severe), and a group's
|
||||
level: the least severity hidden, or none */
|
||||
enum text_filter_severity
|
||||
{
|
||||
_text_filter_off,
|
||||
_text_filter_mild,
|
||||
_text_filter_strong,
|
||||
_text_filter_severe
|
||||
};
|
||||
|
||||
/* where a term may be found: inside any word, at a word's start, or as the
|
||||
whole word (or it and "s" or "es") */
|
||||
enum text_filter_rule
|
||||
{
|
||||
_text_filter_anywhere,
|
||||
_text_filter_start,
|
||||
_text_filter_whole,
|
||||
NUMBER_OF_TEXT_FILTER_RULES
|
||||
};
|
||||
|
||||
/* the most code units of a string looked at (a longer one is drawn as it is) */
|
||||
#define TEXT_FILTER_MAXIMUM_LENGTH 1024
|
||||
|
||||
/* text_filter_match.c */
|
||||
void text_filter_words_reset(void);
|
||||
int text_filter_word_add(char const *term, int group, int severity, int rule);
|
||||
int text_filter_allow_add(char const *word);
|
||||
long text_filter_censor(unsigned short const *text, long length, int narrow, unsigned char const *levels,
|
||||
unsigned char *censored);
|
||||
|
||||
/* text_filter.c */
|
||||
wchar_t const *text_filter_unicode(wchar_t const *string);
|
||||
char const *text_filter_string(char const *string);
|
||||
void text_filter_suspend(void);
|
||||
void text_filter_resume(void);
|
||||
void text_filter_exempt(void const *text);
|
||||
void text_filter_utf8(char *text);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,758 @@
|
||||
/*
|
||||
TEXT_FILTER_MATCH.C
|
||||
|
||||
Streamer mode's matcher: which code units of a string spell a hidden word,
|
||||
however it is dressed (README.md, "Streamer mode"). A string is read as the
|
||||
game draws it (draw_string.c's parsers: a wide string's "|n" breaks a line
|
||||
and any other "|" hides the character after it; a narrow string's style
|
||||
codes are not drawn), and each character it shows becomes an element:
|
||||
|
||||
- a letter, of a-z: the case folded, accents and look-alikes (Cyrillic,
|
||||
Greek, full-width, small capitals: text_filter_fold.inc) made plain;
|
||||
- a digit or symbol read as letters (leet: 0 o, 1 i or l, 3 e, @ a, $ s...),
|
||||
or as any letter (* # % ?, the last of which is what the server browser's
|
||||
listings show for a character they cannot), which may also be
|
||||
punctuation;
|
||||
- a space or punctuation, which a word may be spelled across;
|
||||
- anything else, which no word crosses.
|
||||
|
||||
Two elements together may read as one letter (ph f, vv w, \/ v, |< k).
|
||||
Then each term (text_filter_terms.inc, made by tools/text_filter_terms.py
|
||||
from Surge AI's list; and the player's own) is looked for from each element:
|
||||
a run of one letter reads as one ("fuuuck"); punctuation may come between
|
||||
letters ("f.u.c.k"); spaces too where the pieces are a letter or two
|
||||
("f u c k", "fu ck") or the match is whole words ("f uck"). A term's rule
|
||||
says where it may be (inside a word, at a word's start, or as the whole
|
||||
word), and the allowed words (Scunthorpe) are never hidden. Nothing here
|
||||
knows the game: the harness builds it alone (tools/harness).
|
||||
*/
|
||||
|
||||
#include "text_filter.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define MAXIMUM_TERMS 2048
|
||||
#define MAXIMUM_TERM_CHARACTERS 32768
|
||||
#define MAXIMUM_TERM_LENGTH 40
|
||||
#define MAXIMUM_ALLOWED 1024
|
||||
#define MAXIMUM_ALLOWED_CHARACTERS 16384
|
||||
#define MAXIMUM_GAP 4
|
||||
|
||||
#define ALL_LETTERS 0x03FFFFFFUL
|
||||
#define LETTER(c) (1UL << ((c) - 'a'))
|
||||
|
||||
/* text_filter_terms.inc's terms: their letters with each byte xor'd by
|
||||
TEXT_FILTER_TERM_KEY, so that the program holds no readable list */
|
||||
struct text_filter_term_definition
|
||||
{
|
||||
unsigned char group;
|
||||
unsigned char severity;
|
||||
unsigned char rule;
|
||||
char const *letters;
|
||||
};
|
||||
|
||||
/* text_filter_fold.inc's characters read as letters */
|
||||
struct text_filter_fold
|
||||
{
|
||||
unsigned short code;
|
||||
unsigned long letters;
|
||||
};
|
||||
|
||||
#include "text_filter_terms.inc"
|
||||
#include "text_filter_fold.inc"
|
||||
|
||||
enum
|
||||
{
|
||||
_element_letter,
|
||||
_element_digit,
|
||||
_element_symbol,
|
||||
_element_wildcard,
|
||||
_element_space,
|
||||
_element_punctuation,
|
||||
_element_break
|
||||
};
|
||||
|
||||
struct element
|
||||
{
|
||||
unsigned long letters;
|
||||
unsigned long pair;
|
||||
short first;
|
||||
short last;
|
||||
unsigned short code;
|
||||
unsigned char kind;
|
||||
};
|
||||
|
||||
struct term
|
||||
{
|
||||
short offset;
|
||||
unsigned char length;
|
||||
unsigned char group;
|
||||
unsigned char severity;
|
||||
unsigned char rule;
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
int ready;
|
||||
long term_count;
|
||||
long character_count;
|
||||
struct term terms[MAXIMUM_TERMS];
|
||||
char characters[MAXIMUM_TERM_CHARACTERS];
|
||||
/* the terms by their first letter: first[letter] .. first[letter + 1] of
|
||||
order */
|
||||
short order[MAXIMUM_TERMS];
|
||||
short first[27];
|
||||
int sorted;
|
||||
long allowed_count;
|
||||
long allowed_character_count;
|
||||
short allowed[MAXIMUM_ALLOWED];
|
||||
char allowed_characters[MAXIMUM_ALLOWED_CHARACTERS];
|
||||
} text_filter_words;
|
||||
|
||||
/* a term's or allowed word's letters, kept a-z only (others dropped);
|
||||
their count */
|
||||
static long text_filter_letters(
|
||||
char *letters,
|
||||
long size,
|
||||
char const *text)
|
||||
{
|
||||
long length = 0;
|
||||
|
||||
for (; *text; text++)
|
||||
{
|
||||
char character = *text;
|
||||
|
||||
if (character >= 'A' && character <= 'Z')
|
||||
character = (char)(character - 'A' + 'a');
|
||||
if (character >= 'a' && character <= 'z' && length < size - 1)
|
||||
letters[length++] = character;
|
||||
}
|
||||
letters[length] = 0;
|
||||
return length;
|
||||
}
|
||||
|
||||
static int text_filter_word_store(
|
||||
char const *letters,
|
||||
long length,
|
||||
int group,
|
||||
int severity,
|
||||
int rule)
|
||||
{
|
||||
struct term *term;
|
||||
|
||||
if (length < 2 || length > MAXIMUM_TERM_LENGTH ||
|
||||
text_filter_words.term_count >= MAXIMUM_TERMS ||
|
||||
text_filter_words.character_count + length + 1 > MAXIMUM_TERM_CHARACTERS ||
|
||||
group < 0 || group >= NUMBER_OF_TEXT_FILTER_GROUPS ||
|
||||
severity < _text_filter_mild || severity > _text_filter_severe ||
|
||||
rule < 0 || rule >= NUMBER_OF_TEXT_FILTER_RULES)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
term = &text_filter_words.terms[text_filter_words.term_count++];
|
||||
term->offset = (short)text_filter_words.character_count;
|
||||
term->length = (unsigned char)length;
|
||||
term->group = (unsigned char)group;
|
||||
term->severity = (unsigned char)severity;
|
||||
term->rule = (unsigned char)rule;
|
||||
memcpy(text_filter_words.characters + text_filter_words.character_count, letters, length + 1);
|
||||
text_filter_words.character_count += length + 1;
|
||||
text_filter_words.sorted = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the built-in terms and allowed words again, without the player's */
|
||||
void text_filter_words_reset(
|
||||
void)
|
||||
{
|
||||
long index;
|
||||
|
||||
text_filter_words.term_count = 0;
|
||||
text_filter_words.character_count = 0;
|
||||
text_filter_words.allowed_count = 0;
|
||||
text_filter_words.allowed_character_count = 0;
|
||||
for (index = 0; index < (long)(sizeof(text_filter_term_definitions) / sizeof(*text_filter_term_definitions)); index++)
|
||||
{
|
||||
struct text_filter_term_definition const *definition = &text_filter_term_definitions[index];
|
||||
char letters[MAXIMUM_TERM_LENGTH + 1];
|
||||
long length = 0;
|
||||
char const *encoded;
|
||||
|
||||
for (encoded = definition->letters; *encoded && length < MAXIMUM_TERM_LENGTH; encoded++)
|
||||
letters[length++] = (char)(*encoded ^ TEXT_FILTER_TERM_KEY);
|
||||
letters[length] = 0;
|
||||
text_filter_word_store(letters, length, definition->group, definition->severity, definition->rule);
|
||||
}
|
||||
for (index = 0; index < (long)(sizeof(text_filter_allowed_words) / sizeof(*text_filter_allowed_words)); index++)
|
||||
text_filter_allow_add(text_filter_allowed_words[index]);
|
||||
text_filter_words.ready = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* a term of the player's, hidden at its group's level (a-z: others are
|
||||
dropped); whether it was kept */
|
||||
int text_filter_word_add(
|
||||
char const *term,
|
||||
int group,
|
||||
int severity,
|
||||
int rule)
|
||||
{
|
||||
char letters[MAXIMUM_TERM_LENGTH + 2];
|
||||
long length;
|
||||
|
||||
if (!text_filter_words.ready)
|
||||
text_filter_words_reset();
|
||||
length = text_filter_letters(letters, sizeof(letters), term);
|
||||
return text_filter_word_store(letters, length, group, severity, rule);
|
||||
}
|
||||
|
||||
/* a word never hidden, nor any part of it (a-z); whether it was kept */
|
||||
int text_filter_allow_add(
|
||||
char const *word)
|
||||
{
|
||||
char letters[MAXIMUM_TERM_LENGTH + 2];
|
||||
long length = text_filter_letters(letters, sizeof(letters), word);
|
||||
|
||||
if (length < 2 || length > MAXIMUM_TERM_LENGTH ||
|
||||
text_filter_words.allowed_count >= MAXIMUM_ALLOWED ||
|
||||
text_filter_words.allowed_character_count + length + 1 > MAXIMUM_ALLOWED_CHARACTERS)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
text_filter_words.allowed[text_filter_words.allowed_count++] = (short)text_filter_words.allowed_character_count;
|
||||
memcpy(text_filter_words.allowed_characters + text_filter_words.allowed_character_count, letters, length + 1);
|
||||
text_filter_words.allowed_character_count += length + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the terms by their first letter */
|
||||
static void text_filter_words_sort(
|
||||
void)
|
||||
{
|
||||
long letter;
|
||||
long count = 0;
|
||||
|
||||
for (letter = 0; letter < 26; letter++)
|
||||
{
|
||||
long index;
|
||||
|
||||
text_filter_words.first[letter] = (short)count;
|
||||
for (index = 0; index < text_filter_words.term_count; index++)
|
||||
{
|
||||
if (text_filter_words.characters[text_filter_words.terms[index].offset] == 'a' + letter)
|
||||
text_filter_words.order[count++] = (short)index;
|
||||
}
|
||||
}
|
||||
text_filter_words.first[26] = (short)count;
|
||||
text_filter_words.sorted = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* ---------- elements */
|
||||
|
||||
/* a character above ASCII read as letters (text_filter_fold.inc), or 0 */
|
||||
static unsigned long text_filter_fold_letters(
|
||||
unsigned short code)
|
||||
{
|
||||
long low = 0;
|
||||
long high = (long)(sizeof(text_filter_folds) / sizeof(*text_filter_folds)) - 1;
|
||||
|
||||
while (low <= high)
|
||||
{
|
||||
long middle = (low + high) / 2;
|
||||
|
||||
if (text_filter_folds[middle].code == code)
|
||||
return text_filter_folds[middle].letters;
|
||||
if (text_filter_folds[middle].code < code)
|
||||
low = middle + 1;
|
||||
else
|
||||
high = middle - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* what a character is (an _element_ kind; NONE (-1) for one not drawn), and
|
||||
the letters it may read as */
|
||||
static int text_filter_classify(
|
||||
unsigned short code,
|
||||
unsigned long *letters)
|
||||
{
|
||||
*letters = 0;
|
||||
if (code >= 0xFF01 && code <= 0xFF5E)
|
||||
code = (unsigned short)(code - 0xFEE0);
|
||||
if (code >= 'A' && code <= 'Z')
|
||||
code = (unsigned short)(code - 'A' + 'a');
|
||||
if (code >= 'a' && code <= 'z')
|
||||
{
|
||||
*letters = LETTER(code);
|
||||
return _element_letter;
|
||||
}
|
||||
switch (code)
|
||||
{
|
||||
case '0': *letters = LETTER('o'); return _element_digit;
|
||||
case '1': *letters = LETTER('i') | LETTER('l'); return _element_digit;
|
||||
case '2': *letters = LETTER('z'); return _element_digit;
|
||||
case '3': *letters = LETTER('e'); return _element_digit;
|
||||
case '4': *letters = LETTER('a'); return _element_digit;
|
||||
case '5': *letters = LETTER('s'); return _element_digit;
|
||||
case '6': *letters = LETTER('g') | LETTER('b'); return _element_digit;
|
||||
case '7': *letters = LETTER('t'); return _element_digit;
|
||||
case '8': *letters = LETTER('b'); return _element_digit;
|
||||
case '9': *letters = LETTER('g') | LETTER('q'); return _element_digit;
|
||||
case '@': *letters = LETTER('a'); return _element_symbol;
|
||||
case '$': *letters = LETTER('s'); return _element_symbol;
|
||||
case '!': *letters = LETTER('i'); return _element_symbol;
|
||||
case '+': *letters = LETTER('t'); return _element_symbol;
|
||||
case '(': *letters = LETTER('c'); return _element_symbol;
|
||||
case '<': *letters = LETTER('c'); return _element_symbol;
|
||||
case '|': *letters = LETTER('i') | LETTER('l'); return _element_symbol;
|
||||
case 0x00A1: *letters = LETTER('i'); return _element_symbol;
|
||||
case 0x00A2: *letters = LETTER('c'); return _element_symbol;
|
||||
case 0x00A3: *letters = LETTER('l') | LETTER('e'); return _element_symbol;
|
||||
case 0x00A5: *letters = LETTER('y'); return _element_symbol;
|
||||
case 0x00A7: *letters = LETTER('s'); return _element_symbol;
|
||||
case 0x00A9: *letters = LETTER('c'); return _element_symbol;
|
||||
case 0x00AE: *letters = LETTER('r'); return _element_symbol;
|
||||
case 0x00D7: *letters = LETTER('x'); return _element_symbol;
|
||||
case 0x20AC: *letters = LETTER('e'); return _element_symbol;
|
||||
case '*': case '#': case '%': case '?':
|
||||
*letters = ALL_LETTERS;
|
||||
return _element_wildcard;
|
||||
case ' ': case '\t': case '\r': case '\n': case 0x00A0: case 0x1680: case 0x202F: case 0x205F: case 0x3000:
|
||||
return _element_space;
|
||||
}
|
||||
if (code >= 0x2000 && code <= 0x200A)
|
||||
return _element_space;
|
||||
/* invisible: the soft hyphen, joiners, marks over letters, direction
|
||||
and variation selectors */
|
||||
if (code == 0x00AD || code == 0x034F || code == 0x180E || code == 0xFEFF ||
|
||||
(code >= 0x0300 && code <= 0x036F) || (code >= 0x1AB0 && code <= 0x1AFF) ||
|
||||
(code >= 0x1DC0 && code <= 0x1DFF) || (code >= 0x20D0 && code <= 0x20FF) ||
|
||||
(code >= 0x200B && code <= 0x200F) || (code >= 0x202A && code <= 0x202E) ||
|
||||
(code >= 0x2060 && code <= 0x2069) || (code >= 0xFE00 && code <= 0xFE0F) ||
|
||||
(code >= 0xFE20 && code <= 0xFE2F))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (code >= 0x80)
|
||||
{
|
||||
*letters = text_filter_fold_letters(code);
|
||||
if (*letters)
|
||||
return _element_letter;
|
||||
}
|
||||
if ((code > ' ' && code < 0x7F) || (code >= 0x00A1 && code <= 0x00BF) ||
|
||||
(code >= 0x2010 && code <= 0x2027) || (code >= 0x2030 && code <= 0x205E))
|
||||
{
|
||||
return _element_punctuation;
|
||||
}
|
||||
return _element_break;
|
||||
}
|
||||
|
||||
static int text_filter_style_code(
|
||||
unsigned short code)
|
||||
{
|
||||
return code && code < 0x80 && strchr("ibukprlctn", (char)code) != NULL;
|
||||
}
|
||||
|
||||
/* the string's elements as it is drawn; their count */
|
||||
static long text_filter_elements(
|
||||
unsigned short const *text,
|
||||
long length,
|
||||
int narrow,
|
||||
struct element *elements,
|
||||
long maximum)
|
||||
{
|
||||
long count = 0;
|
||||
long index = 0;
|
||||
long element_index;
|
||||
|
||||
while (index < length && count < maximum)
|
||||
{
|
||||
unsigned short code = text[index];
|
||||
struct element *element = &elements[count];
|
||||
long last = index;
|
||||
int kind;
|
||||
|
||||
if (code == '|' && index + 1 < length)
|
||||
{
|
||||
unsigned short next = text[index + 1];
|
||||
|
||||
if (narrow ? text_filter_style_code(next) : 1)
|
||||
{
|
||||
last = index + 1;
|
||||
if (next == 'n' || (narrow && next == 't'))
|
||||
{
|
||||
element->letters = 0;
|
||||
element->kind = _element_space;
|
||||
element->code = ' ';
|
||||
element->first = (short)index;
|
||||
element->last = (short)last;
|
||||
count++;
|
||||
index = last + 1;
|
||||
continue;
|
||||
}
|
||||
if (narrow)
|
||||
{
|
||||
/* a style code: not drawn */
|
||||
index = last + 1;
|
||||
continue;
|
||||
}
|
||||
/* a wide string's "|": drawn, the character after it not */
|
||||
}
|
||||
}
|
||||
kind = text_filter_classify(code, &element->letters);
|
||||
if (kind < 0)
|
||||
{
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
element->kind = (unsigned char)kind;
|
||||
element->code = code >= 'A' && code <= 'Z' ? (unsigned short)(code - 'A' + 'a') : code;
|
||||
element->first = (short)index;
|
||||
element->last = (short)last;
|
||||
count++;
|
||||
index = last + 1;
|
||||
}
|
||||
|
||||
/* pairs read as one letter */
|
||||
for (element_index = 0; element_index < count; element_index++)
|
||||
{
|
||||
unsigned short first = elements[element_index].code;
|
||||
unsigned short second = element_index + 1 < count ? elements[element_index + 1].code : 0;
|
||||
unsigned long pair = 0;
|
||||
|
||||
if (first == 'p' && second == 'h') pair = LETTER('f');
|
||||
else if (first == 'v' && second == 'v') pair = LETTER('w');
|
||||
else if (first == '\\' && second == '/') pair = LETTER('v');
|
||||
else if (first == '/' && second == '\\') pair = LETTER('a');
|
||||
else if (first == '|' && second == '<') pair = LETTER('k');
|
||||
else if (first == '>' && second == '<') pair = LETTER('x');
|
||||
else if (first == '(' && second == ')') pair = LETTER('o');
|
||||
else if (first == '[' && second == ']') pair = LETTER('o');
|
||||
else if (first == '|' && second == ')') pair = LETTER('d');
|
||||
elements[element_index].pair = pair;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* ---------- matching */
|
||||
|
||||
struct attempt
|
||||
{
|
||||
struct element const *elements;
|
||||
long count;
|
||||
char const *letters;
|
||||
long length;
|
||||
int rule;
|
||||
long start;
|
||||
long end;
|
||||
};
|
||||
|
||||
/* what a match has crossed so far */
|
||||
struct path
|
||||
{
|
||||
long wildcards;
|
||||
long real_letters;
|
||||
long piece;
|
||||
long longest_piece;
|
||||
int spaced;
|
||||
int crossed;
|
||||
};
|
||||
|
||||
static int text_filter_try_letter(struct attempt *attempt, long term_index, long element_index, struct path path);
|
||||
|
||||
static int text_filter_word_character(
|
||||
struct element const *element)
|
||||
{
|
||||
return element->kind == _element_letter;
|
||||
}
|
||||
|
||||
/* whether an allowed word covers the match, inside the word it is in */
|
||||
static int text_filter_allowed(
|
||||
struct attempt const *attempt)
|
||||
{
|
||||
long word_start = attempt->start;
|
||||
long word_end = attempt->end;
|
||||
long index;
|
||||
|
||||
while (word_start > 0 &&
|
||||
(attempt->elements[word_start - 1].kind == _element_letter || attempt->elements[word_start - 1].kind == _element_digit))
|
||||
{
|
||||
word_start--;
|
||||
}
|
||||
while (word_end < attempt->count &&
|
||||
(attempt->elements[word_end].kind == _element_letter || attempt->elements[word_end].kind == _element_digit))
|
||||
{
|
||||
word_end++;
|
||||
}
|
||||
for (index = 0; index < text_filter_words.allowed_count; index++)
|
||||
{
|
||||
char const *allowed = text_filter_words.allowed_characters + text_filter_words.allowed[index];
|
||||
long length = (long)strlen(allowed);
|
||||
long at;
|
||||
|
||||
for (at = word_start; at + length <= word_end; at++)
|
||||
{
|
||||
long offset;
|
||||
|
||||
if (at > attempt->start || at + length < attempt->end)
|
||||
continue;
|
||||
for (offset = 0; offset < length; offset++)
|
||||
{
|
||||
if (!(attempt->elements[at + offset].letters & LETTER(allowed[offset])))
|
||||
break;
|
||||
}
|
||||
if (offset == length)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* the term read to the element before end: whether the match stands */
|
||||
static int text_filter_finish(
|
||||
struct attempt *attempt,
|
||||
long end,
|
||||
struct path path)
|
||||
{
|
||||
struct element const *elements = attempt->elements;
|
||||
int start_boundary = attempt->start == 0 || !text_filter_word_character(&elements[attempt->start - 1]);
|
||||
int end_boundary = end >= attempt->count || !text_filter_word_character(&elements[end]);
|
||||
|
||||
if (path.piece > path.longest_piece)
|
||||
path.longest_piece = path.piece;
|
||||
/* any letter (* ? #) once in a short word, twice in a longer one, and
|
||||
never in a word of three letters */
|
||||
if (path.wildcards && (attempt->length < 4 || path.wildcards > (attempt->length <= 5 ? 1 : 2)))
|
||||
return 0;
|
||||
/* a third of the letters letters, not digits or symbols (not "8008") */
|
||||
if (!path.real_letters || path.real_letters * 3 < attempt->length)
|
||||
return 0;
|
||||
/* across spaces: pieces of a letter or two, or whole words */
|
||||
if (path.spaced && path.longest_piece > 2 && !(start_boundary && end_boundary))
|
||||
return 0;
|
||||
switch (attempt->rule)
|
||||
{
|
||||
case _text_filter_start:
|
||||
if (!start_boundary)
|
||||
return 0;
|
||||
break;
|
||||
case _text_filter_whole:
|
||||
if (!start_boundary)
|
||||
return 0;
|
||||
if (!end_boundary)
|
||||
{
|
||||
/* or with "s", or "es" after s, x, z, ch or sh */
|
||||
long after = end;
|
||||
char last = attempt->letters[attempt->length - 1];
|
||||
char before_last = attempt->length > 1 ? attempt->letters[attempt->length - 2] : 0;
|
||||
|
||||
if ((last == 's' || last == 'x' || last == 'z' || (last == 'h' && (before_last == 'c' || before_last == 's'))) &&
|
||||
after < attempt->count && (elements[after].letters & LETTER('e')) && elements[after].kind == _element_letter &&
|
||||
after + 1 < attempt->count && (elements[after + 1].letters & LETTER('s')))
|
||||
{
|
||||
after++;
|
||||
}
|
||||
if (after < attempt->count && (elements[after].letters & LETTER('s')) &&
|
||||
(elements[after].kind == _element_letter || elements[after].kind == _element_digit) &&
|
||||
(after + 1 >= attempt->count || !text_filter_word_character(&elements[after + 1])))
|
||||
{
|
||||
end = after + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!path.crossed)
|
||||
{
|
||||
attempt->end = end;
|
||||
if (text_filter_allowed(attempt))
|
||||
return 0;
|
||||
}
|
||||
attempt->end = end;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the term's letter at term_index from element_index on, after what came
|
||||
before (spaces and punctuation between letters skipped, at most
|
||||
MAXIMUM_GAP) */
|
||||
static int text_filter_next(
|
||||
struct attempt *attempt,
|
||||
long term_index,
|
||||
long element_index,
|
||||
long gap,
|
||||
int spaced,
|
||||
struct path path)
|
||||
{
|
||||
struct element const *element;
|
||||
|
||||
if (term_index == attempt->length)
|
||||
return text_filter_finish(attempt, element_index, path);
|
||||
if (element_index >= attempt->count)
|
||||
return 0;
|
||||
element = &attempt->elements[element_index];
|
||||
if (gap > 0)
|
||||
{
|
||||
path.crossed = 1;
|
||||
if (spaced)
|
||||
{
|
||||
path.spaced = 1;
|
||||
if (path.piece > path.longest_piece)
|
||||
path.longest_piece = path.piece;
|
||||
path.piece = 0;
|
||||
}
|
||||
}
|
||||
if ((element->letters || element->pair) && text_filter_try_letter(attempt, term_index, element_index, path))
|
||||
return 1;
|
||||
if (term_index > 0 && gap < MAXIMUM_GAP &&
|
||||
(element->kind == _element_space || element->kind == _element_punctuation ||
|
||||
element->kind == _element_symbol || element->kind == _element_wildcard))
|
||||
{
|
||||
return text_filter_next(attempt, term_index, element_index + 1, gap + 1,
|
||||
spaced || element->kind == _element_space, path);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* after the term's letter at term_index, read to element end: the same
|
||||
letter again ("fuuuck") is part of it, unless the term has it twice; for a
|
||||
short whole word, only three or more of it ("woops" is not a short word's
|
||||
"o" twice) */
|
||||
static int text_filter_after(
|
||||
struct attempt *attempt,
|
||||
long term_index,
|
||||
long end,
|
||||
struct path path)
|
||||
{
|
||||
char letter = attempt->letters[term_index];
|
||||
|
||||
if (term_index + 1 >= attempt->length || attempt->letters[term_index + 1] != letter)
|
||||
{
|
||||
long repeated = end;
|
||||
|
||||
while (repeated < attempt->count &&
|
||||
(attempt->elements[repeated].kind == _element_letter || attempt->elements[repeated].kind == _element_digit) &&
|
||||
(attempt->elements[repeated].letters & LETTER(letter)))
|
||||
{
|
||||
repeated++;
|
||||
}
|
||||
if (repeated != end &&
|
||||
(attempt->rule != _text_filter_whole || attempt->length > 4 || repeated - end >= 2))
|
||||
{
|
||||
struct path longer = path;
|
||||
|
||||
longer.piece += repeated - end;
|
||||
if (text_filter_next(attempt, term_index + 1, repeated, 0, 0, longer))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return text_filter_next(attempt, term_index + 1, end, 0, 0, path);
|
||||
}
|
||||
|
||||
static int text_filter_try_letter(
|
||||
struct attempt *attempt,
|
||||
long term_index,
|
||||
long element_index,
|
||||
struct path path)
|
||||
{
|
||||
struct element const *element = &attempt->elements[element_index];
|
||||
unsigned long letter = LETTER(attempt->letters[term_index]);
|
||||
|
||||
if (element->letters & letter)
|
||||
{
|
||||
struct path one = path;
|
||||
|
||||
one.piece++;
|
||||
if (element->kind == _element_wildcard)
|
||||
one.wildcards++;
|
||||
else if (element->kind == _element_letter)
|
||||
one.real_letters++;
|
||||
if ((element->kind != _element_wildcard || term_index > 0) &&
|
||||
text_filter_after(attempt, term_index, element_index + 1, one))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (element->pair & letter)
|
||||
{
|
||||
struct path two = path;
|
||||
|
||||
two.piece++;
|
||||
if (element->kind == _element_letter)
|
||||
two.real_letters++;
|
||||
if (text_filter_after(attempt, term_index, element_index + 2, two))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* which code units of the text (of a wide string, or narrow: char's widened)
|
||||
spell a term of a group whose level its severity reaches (levels: one for
|
||||
each group, _text_filter_off or the least severity hidden), marked in
|
||||
censored (as long as the text); how many */
|
||||
long text_filter_censor(
|
||||
unsigned short const *text,
|
||||
long length,
|
||||
int narrow,
|
||||
unsigned char const *levels,
|
||||
unsigned char *censored)
|
||||
{
|
||||
static struct element elements[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
long count;
|
||||
long start;
|
||||
long marked = 0;
|
||||
|
||||
memset(censored, 0, length);
|
||||
if (!text_filter_words.ready)
|
||||
text_filter_words_reset();
|
||||
if (!text_filter_words.sorted)
|
||||
text_filter_words_sort();
|
||||
count = text_filter_elements(text, length, narrow, elements, TEXT_FILTER_MAXIMUM_LENGTH);
|
||||
for (start = 0; start < count; start++)
|
||||
{
|
||||
unsigned long letters = elements[start].kind == _element_wildcard ? 0 : (elements[start].letters | elements[start].pair);
|
||||
long letter;
|
||||
|
||||
for (letter = 0; letters && letter < 26; letter++)
|
||||
{
|
||||
long order;
|
||||
|
||||
if (!(letters & (1UL << letter)))
|
||||
continue;
|
||||
for (order = text_filter_words.first[letter]; order < text_filter_words.first[letter + 1]; order++)
|
||||
{
|
||||
struct term const *term = &text_filter_words.terms[text_filter_words.order[order]];
|
||||
struct attempt attempt;
|
||||
struct path path;
|
||||
|
||||
if (levels[term->group] == _text_filter_off || term->severity < levels[term->group])
|
||||
continue;
|
||||
attempt.elements = elements;
|
||||
attempt.count = count;
|
||||
attempt.letters = text_filter_words.characters + term->offset;
|
||||
attempt.length = term->length;
|
||||
attempt.rule = term->rule;
|
||||
attempt.start = start;
|
||||
attempt.end = start;
|
||||
memset(&path, 0, sizeof(path));
|
||||
if (text_filter_try_letter(&attempt, 0, start, path))
|
||||
{
|
||||
long unit;
|
||||
|
||||
for (unit = elements[start].first; unit <= elements[attempt.end - 1].last; unit++)
|
||||
{
|
||||
if (!censored[unit])
|
||||
{
|
||||
censored[unit] = 1;
|
||||
marked++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return marked;
|
||||
}
|
||||
@@ -0,0 +1,688 @@
|
||||
/* port/linux/game/text_filter_terms.inc: streamer mode's words, written by
|
||||
tools/text_filter_terms.py from Surge AI's profanity_en.csv
|
||||
(sha256 ca4ff7d713a8e6f6ec2616f489cd09f6fb96b8b3af404a207783be58a91f3ede) and port/assets/text_filter/review.txt and allow.txt.
|
||||
Each term's letters are xor'd with TEXT_FILTER_TERM_KEY. Do not edit. */
|
||||
|
||||
#define TEXT_FILTER_TERM_KEY 0x5A
|
||||
|
||||
static struct text_filter_term_definition const text_filter_term_definitions[] =
|
||||
{
|
||||
{ _text_filter_insults, 1, _text_filter_anywhere, "\x3D\x33\x28\x36\x33\x3F\x38\x35\x23" },
|
||||
{ _text_filter_insults, 1, _text_filter_anywhere, "\x3D\x33\x28\x36\x23\x38\x35\x23" },
|
||||
{ _text_filter_insults, 1, _text_filter_anywhere, "\x29\x39\x2F\x37\x37\x23" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x39\x2F\x39\x31" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x3E\x35\x36\x2E" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x30\x3F\x28\x31" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x34\x35\x34\x39\x3F" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x29\x39\x2F\x37" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x29\x33\x29\x29\x23" },
|
||||
{ _text_filter_insults, 1, _text_filter_whole, "\x2E\x35\x29\x29\x3F\x28" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x38\x3B\x29\x29\x2E\x2F\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x38\x3B\x29\x2E\x3B\x28\x3E\x33\x29\x32" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x38\x3B\x29\x2E\x3B\x28\x3E\x29" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x38\x3B\x29\x2E\x3F\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x38\x3B\x29\x2E\x2F\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x3E\x2F\x37\x38\x38\x3B\x29\x2E\x3B\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2A\x3F\x3E\x35\x38\x3F\x3B\x28" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2A\x3F\x3E\x35\x2A\x32\x33\x36\x3F" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2A\x3F\x3E\x35\x2A\x32\x36" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2A\x3F\x3E\x35\x20" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x28\x3B\x2E\x38\x3B\x29\x2E\x3B\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x28\x3B\x2E\x38\x3B\x20\x2E\x3B\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2E\x2F\x28\x3E\x39\x2F\x2E\x2E\x3F\x28" },
|
||||
{ _text_filter_insults, 2, _text_filter_anywhere, "\x2E\x2F\x28\x3E\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x38\x3B\x29\x2E\x3B\x28\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x38\x3B\x29\x2E\x33\x3E" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x3D\x35\x2D\x36" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x31\x23\x29" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x2A\x3F\x3E\x35" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x2A\x3F\x3E\x35\x29" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x2E\x32\x35\x2E" },
|
||||
{ _text_filter_insults, 2, _text_filter_whole, "\x2E\x2F\x28\x3E" },
|
||||
{ _text_filter_insults, 3, _text_filter_anywhere, "\x31\x33\x36\x36\x2F\x28\x29\x3F\x36\x3C" },
|
||||
{ _text_filter_insults, 3, _text_filter_anywhere, "\x31\x33\x36\x36\x23\x35\x2F\x28\x29\x3F\x36\x3C" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x38\x3F\x3B\x34\x2B\x2F\x3F\x3F\x34" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x3C\x2F\x3E\x3D\x3F\x2A\x3B\x39\x31\x3F\x28" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x35\x2C\x3F\x34\x3E\x35\x3E\x3D\x3F\x28" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x3B\x39\x31\x3F\x28\x3C\x2F\x3E\x3D\x3F\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x3B\x39\x31\x33\x34\x3D\x3C\x2F\x3E\x3D\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x3B\x39\x31\x37\x23\x3C\x2F\x3E\x3D\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x3B\x34\x39\x3B\x31\x3F\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x3F\x2E\x3F\x28\x2A\x2F\x3C\x3C\x3F\x28" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2A\x33\x36\x36\x35\x2D\x38\x33\x2E\x3F\x28" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x28\x3F\x3E\x29\x31\x33\x34" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2E\x3B\x39\x35\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2D\x33\x34\x3E\x35\x2D\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x2D\x35\x2A\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x20\x33\x2A\x33\x34\x2E\x32\x3F\x2D\x33\x28\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_anywhere, "\x20\x33\x2A\x2A\x3F\x28\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_start, "\x3B\x38\x35\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_start, "\x3D\x28\x35\x33\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x3B\x38\x3F\x3F\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x3B\x38\x35" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x38\x36\x3B\x39\x31\x23" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x39\x35\x35\x36\x33\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x3E\x3B\x3D\x35" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x3D\x23\x2A" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x3D\x23\x2A\x29\x23" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x32\x3F\x38\x3F" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x32\x3F\x3F\x38" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x33\x34\x30\x2F\x34" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x31\x31\x31" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x31\x36\x3B\x34" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x37\x35\x34\x3D" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x37\x35\x34\x3D\x35\x36\x35\x33\x3E" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x29\x3B\x37\x38\x35" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x29\x32\x23\x36\x35\x39\x31" },
|
||||
{ _text_filter_slurs, 2, _text_filter_whole, "\x2D\x35\x2A" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x38\x3F\x3B\x34\x3F\x28\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x3B\x37\x3F\x36\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x3B\x28\x2A\x3F\x2E\x37\x2F\x34\x39\x32\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x3B\x28\x2A\x3F\x2E\x37\x2F\x34\x39\x32\x33\x34\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x32\x33\x34\x3B\x2C\x33\x28\x2F\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x32\x33\x34\x3F\x29\x3F\x2C\x33\x28\x2F\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x32\x33\x34\x3D\x39\x32\x35\x34\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x32\x33\x34\x31\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x39\x35\x2E\x2E\x35\x34\x2A\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3E\x3B\x28\x31\x33\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3E\x35\x2E\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3E\x2F\x34\x3F\x39\x35\x35\x34" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x38\x3B\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x3F\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x3D\x35\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x2B\x2F\x3F\x3F\x34" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x3B\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x3C\x2F\x28\x3C\x3B\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x32\x3F\x33\x36\x32\x33\x2E\x36\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3B\x38\x35\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3D\x3B\x38\x35\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3D\x3B\x38\x2F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3D\x3B\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3D\x3F\x28\x38\x35\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x30\x33\x3D\x3D\x23\x38\x35\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x31\x33\x31\x3F\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x31\x34\x3F\x3F\x3D\x28\x35\x2D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x31\x2F\x31\x36\x2F\x22\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x31\x23\x31\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x36\x3B\x3E\x38\x35\x23\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x36\x3B\x3E\x38\x35\x23\x20" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x36\x3B\x3E\x33\x38\x35\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x36\x3B\x3E\x23\x38\x35\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x37\x3F\x39\x32\x3B\x3C\x3B\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x37\x3F\x3D\x3B\x3C\x3B\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x3F\x3D\x28\x35\x3F\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x39\x31\x3B\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x3B\x32" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x3D\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x3D\x33\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x3D\x2F\x32" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x36\x3F\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x34\x33\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x34\x35\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x3D\x2F\x32" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x33\x31\x31\x3B\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x34\x2F\x39\x31\x3B\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2A\x32\x3B\x3D\x3D\x35\x2E\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2A\x32\x3B\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2A\x35\x28\x39\x32\x37\x35\x34\x31\x3F\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x28\x3B\x3D\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x28\x3F\x2E\x3B\x28\x3E\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x32\x3F\x37\x3B\x36\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x32\x37\x3B\x36\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x33\x3F\x3D\x32\x3F\x33\x36" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x36\x3B\x34\x2E\x3F\x23\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x36\x3B\x34\x2E\x3C\x28\x3F\x3B\x31" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x36\x3B\x34\x2E\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x29\x2A\x33\x22" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2E\x3B\x28\x38\x3B\x38\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2E\x35\x2D\x3F\x36\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_anywhere, "\x2D\x3F\x2E\x38\x3B\x39\x31" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x3C\x3B\x3D\x3D\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x3C\x36\x3B\x37\x3F\x28\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x32\x33\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x32\x33\x3D\x3D\x3F\x28\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x34\x33\x39\x39\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x34\x33\x3D\x3F\x28\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x34\x33\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x34\x33\x31\x31\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x2A\x32\x3B\x3D\x3D\x35\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x2A\x32\x3B\x3D\x35\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x29\x2A\x33\x39\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_start, "\x2D\x33\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x38\x3F\x3B\x34\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x39\x32\x33\x34\x31" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x39\x35\x35\x34" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x39\x35\x35\x34\x33\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x39\x35\x35\x34\x33\x3F\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x39\x35\x35\x34\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3E\x3B\x28\x31\x23" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3E\x23\x31\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3C\x3B\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3C\x3B\x3D\x3D\x33\x34\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3C\x3B\x3D\x3D\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3C\x3B\x3D\x35\x2E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3C\x36\x3B\x37\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x3D\x35\x35\x31" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x32\x33\x3D\x3D\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x30\x3B\x2A" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x30\x33\x3D\x3D\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x31\x33\x31\x3F" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x3F\x3D\x3D\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x3F\x3D\x3D\x3B\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x3F\x3D\x28\x35" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x3F\x3D\x28\x35\x33\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x39\x31\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x39\x31\x31\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x3D\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x3D\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x3D\x3D\x28\x3F\x29\x29" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x34\x33\x3D\x28\x3B" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x2A\x3B\x31\x33" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x28\x3F\x2E\x3B\x28\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x28\x3F\x2E\x3B\x28\x3E\x3F\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x29\x2A\x33\x39" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x29\x2A\x33\x3D" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x29\x2A\x33\x31" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x2E\x3B\x28\x3E" },
|
||||
{ _text_filter_slurs, 3, _text_filter_whole, "\x2E\x28\x3B\x34\x34\x23" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x3B\x38\x23\x38\x3B\x2E\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x3B\x36\x36\x29\x3B\x39\x31" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x3F\x3B\x2E\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x3F\x36\x36\x3F\x34\x3E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x3F\x2D\x38\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x2F\x3D\x3D\x3F\x28\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x2F\x2E\x2E\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x2F\x2E\x2E\x37\x2F\x34\x39\x32\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x38\x2F\x2E\x2E\x2A\x33\x28\x3B\x2E\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x39\x3B\x37\x3F\x36\x2E\x35\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x39\x32\x35\x31\x3F\x2E\x32\x3F\x39\x32\x33\x39\x31\x3F\x34" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3E\x35\x2F\x39\x32\x3F\x38\x3B\x3D" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3E\x35\x2F\x39\x32\x3F\x39\x3B\x34\x35\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3C\x2F\x34\x38\x3B\x3D\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3D\x33\x28\x36\x23\x38\x33\x2E\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3D\x35\x3E\x3B\x37\x34\x33\x2E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3D\x35\x3E\x3E\x3B\x37\x37\x33\x2E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3D\x35\x3E\x3E\x3B\x37\x34\x33\x2E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x3D\x35\x2E\x35\x32\x3F\x36\x36" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x30\x3B\x39\x31\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x37\x3B\x34\x39\x32\x35\x2D\x3E\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x37\x3B\x34\x29\x3F\x3F\x3E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x37\x2F\x29\x32\x28\x35\x35\x37\x2E\x33\x2A" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2A\x3B\x36\x37\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2A\x33\x29\x29\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2A\x33\x29\x29\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2A\x2F\x36\x36\x2E\x32\x3F\x2A\x2F\x3E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x28\x3F\x3B\x39\x32\x3B\x28\x35\x2F\x34\x3E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x29\x39\x32\x36\x35\x34\x3D" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x29\x32\x36\x35\x34\x3D" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x29\x2E\x2F\x37\x2A\x39\x32\x3F\x2D\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2E\x3B\x3E\x3D\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2E\x3B\x31\x33\x34\x3D\x2E\x32\x3F\x2A\x33\x29\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2E\x3B\x36\x36\x23\x2D\x3B\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2E\x33\x39\x31\x36\x3F\x2E\x32\x3F\x2A\x33\x39\x31\x36\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2E\x28\x35\x2F\x29\x3F\x28\x29\x34\x3B\x31\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2F\x2A\x29\x31\x33\x28\x2E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_anywhere, "\x2D\x32\x3B\x39\x31\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x38\x35\x34\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x38\x35\x35\x38\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x38\x2F\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x38\x2F\x2E\x2E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3E\x3B\x37\x34" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3E\x33\x36\x3E\x35" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3E\x35\x35\x29\x32" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3E\x35\x2F\x39\x32\x3F" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3D\x35\x3E\x3E\x3B\x37" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3D\x35\x3E\x3E\x3B\x37\x34" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x3D\x35\x3E\x3E\x3B\x37\x34\x3F\x3E" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x32\x3F\x36\x36" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x32\x35\x28\x34\x23" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x35\x28\x3D\x3B\x29\x37" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x2A\x33\x29\x29" },
|
||||
{ _text_filter_swearing, 1, _text_filter_whole, "\x2E\x33\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x32\x3F\x3D\x3B\x35" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x3B\x36\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x3B\x36\x32\x35\x28\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x3B\x36\x33\x34\x3D\x2F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x3B\x36\x2A\x33\x28\x3B\x2E\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x3B\x36\x2A\x36\x2F\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x34\x33\x36\x33\x34\x3D\x2F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x28\x29\x3F\x38\x3B\x34\x3E\x33\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x28\x29\x3F\x3D\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x28\x29\x3F\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x28\x29\x3F\x29\x32\x3B\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3B\x28\x29\x3F\x2D\x33\x2A\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x3B\x36\x36\x38\x3B\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x3F\x3F\x35\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x3F\x23\x35\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x3F\x23\x35\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x3B\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x35\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x3F\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x3F\x20" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x36\x33\x31\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x34\x3F\x29\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x2E\x33\x2E\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x2E\x39\x32\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x33\x20\x20\x3B\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x36\x35\x2D\x3B\x36\x35\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x36\x35\x2D\x30\x35\x38" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x36\x2F\x37\x2A\x31\x33\x34" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x35\x36\x36\x35\x39\x31" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x35\x36\x36\x35\x22" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x38\x2E\x35\x2E\x32\x3F\x33\x34\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x3B\x37\x3D\x33\x28\x36" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x32\x35\x3B\x3E\x34\x3F\x39\x2E\x3B\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x36\x33\x2E\x36\x33\x39\x31\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x35\x38\x38\x31\x34\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x28\x3B\x20\x23\x29\x35\x38" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x28\x3F\x3B\x37\x2A\x33\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x39\x2F\x34\x34\x33\x36\x33\x34\x3D\x2F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x33\x28\x2E\x23\x29\x3B\x34\x39\x32\x3F\x20" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x35\x3D\x3D\x35\x29\x2E\x23\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x35\x3D\x3D\x23\x29\x2E\x23\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x35\x3D\x33\x3F\x29\x2E\x23\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x35\x3D\x29\x2E\x23\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3E\x2F\x37\x2A\x3B\x36\x35\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3F\x28\x3F\x39\x2E\x35\x2A\x36\x3B\x29\x37" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3C\x3F\x39\x31\x3B\x28\x29\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3C\x3F\x36\x36\x3B\x2E\x33\x35\x3B\x3C\x33\x39\x33\x35\x34\x3B\x3E\x35" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3C\x3F\x36\x36\x3B\x2E\x35\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3C\x2F\x2E\x3B\x34\x3B\x28\x33" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3D\x3B\x29\x32\x29\x2E\x3B\x38\x38\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x3D\x33\x34\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x32\x3B\x28\x28\x23\x2A\x3B\x36\x37\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x32\x3F\x34\x2E\x3B\x33" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x32\x35\x3F\x38\x3B\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3B\x39\x31\x3B\x28\x29\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3B\x39\x31\x35\x3C\x3C\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3B\x39\x31\x35\x3C\x3C\x20" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3B\x3D\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3B\x33\x36\x38\x3B\x33\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3F\x28\x31\x33\x34\x3D\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3F\x28\x31\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x3F\x28\x31\x29\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x30\x35\x3C\x3C\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x33\x3E\x3E\x23\x2E\x35\x2F\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x33\x3E\x2E\x35\x2F\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x33\x2E\x2E\x23\x2A\x2F\x34\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x36\x33\x2E\x35\x28\x33\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x34\x35\x38\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x34\x35\x38\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x34\x35\x38\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x31\x34\x35\x38\x3D\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x37\x3F\x3B\x2E\x39\x2F\x28\x2E\x3B\x33\x34\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x38\x23\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x30\x35\x39\x31\x33\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x30\x35\x39\x31\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x35\x38\x30\x35\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x34\x2F\x2E\x29\x3B\x39\x31" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x3F\x39\x31\x3F\x28\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x35\x36\x3F\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x35\x36\x3F\x29\x37\x35\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x35\x36\x3F\x29\x2F\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x35\x28\x34" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x28\x33\x39\x31\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x28\x33\x39\x31\x3D\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x28\x33\x39\x31\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2A\x2F\x34\x3B\x34\x33" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x28\x33\x37\x30\x35\x38" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x3B\x36\x3B\x3E\x2E\x35\x29\x29\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x31\x3B\x34\x31" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x36\x2F\x2E\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x36\x2F\x2E\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x36\x2F\x2E\x2E\x23" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x35\x34\x34\x3B\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x35\x34\x35\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x35\x34\x35\x3C\x3B\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x35\x2A\x2A\x23\x38\x35\x36\x36\x2F\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x2E\x2F\x2A\x33\x3E\x32\x35\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x2F\x37\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x29\x2F\x37\x35\x3C\x3B\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x32\x28\x35\x3B\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x32\x28\x35\x3B\x2E\x23\x35\x3D\x2F\x28\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x35\x29\x29\x33\x34\x3D\x29\x3B\x36\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x2D\x3B\x2E\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x2D\x3B\x2E\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x2D\x3B\x2E\x2E\x33\x29\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x2D\x3B\x2E\x2D\x3B\x3C\x3C\x36\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2E\x2D\x3B\x2E\x20\x33\x36\x36\x3B" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2D\x3B\x34\x31\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2D\x3B\x34\x31\x35\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2D\x32\x35\x3B\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2D\x33\x36\x36\x23\x2D\x32\x3B\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_anywhere, "\x2D\x34\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x38\x33\x39\x32\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x38\x33\x29\x32\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x39\x32\x35\x3B\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x39\x32\x35\x39\x32\x3B" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x33\x34\x39\x3F\x29\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x29\x35\x3B\x38" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x2D\x3B\x34\x31\x3F\x3E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x2D\x3B\x34\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x2D\x3B\x34\x31\x33\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x2D\x3B\x34\x31\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x2D\x3B\x34\x31\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_start, "\x23\x33\x3C\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x3B\x34\x3B\x36" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x3B\x28\x29\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x38\x33\x2E\x39\x32" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x38\x33\x2E\x39\x32\x33\x34" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x39\x36\x33\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x3C\x3F\x36\x36\x3B\x2E\x33\x35" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x3C\x2F\x2E\x3B" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x32\x35\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x32\x35\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x31\x34\x35\x38" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x37\x3B\x29\x2E\x2F\x28\x38\x3B\x2E\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x37\x33\x36\x3C" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x34\x2F\x3E\x3F\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2A\x3F\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2A\x28\x33\x39\x31" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2A\x28\x33\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x28\x3B\x2A\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x28\x3B\x2A\x33\x29\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x29\x36\x3B\x3D" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x29\x36\x2F\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2E\x2D\x3B\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2E\x2D\x3B\x2E\x2E" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2D\x3B\x34\x31" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2D\x32\x35\x28\x3F" },
|
||||
{ _text_filter_swearing, 2, _text_filter_whole, "\x2D\x32\x35\x28\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x38\x3B\x34\x3E\x33\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x3F\x3B\x2E\x33\x34\x3D\x34\x35\x38\x30\x35\x31\x3F\x23\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x32\x3B\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x31\x33\x29\x29\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x36\x33\x39\x31\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x37\x2F\x34\x39\x32" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x2D\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x29\x29\x2D\x33\x2A\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3B\x20\x20\x32\x35\x36\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x38\x3F\x29\x2E\x33\x3B\x36\x33\x2E\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x38\x35\x33\x35\x36\x3B\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x3B\x2D\x31\x37\x2F\x34\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x3B\x2D\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x38\x35\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x3E\x28\x35\x2A\x36\x3F\x2E\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x3F\x3B\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x3D\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x32\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x31\x34\x35\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x37\x35\x34\x3D\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x37\x2F\x34\x39\x32" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x28\x33\x3E\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x31\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x37\x35\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x34\x35\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x2F\x39\x39" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x2F\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x29\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x31\x2E\x3F\x3B\x29\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x39\x29\x2F\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x31\x37\x2F\x34\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x35\x31\x29\x2F\x39\x31\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x28\x3B\x20\x23\x37\x35\x3C\x35\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x31\x29\x2F\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x31\x29\x2F\x31\x31\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x37\x3E\x2F\x37\x2A\x29\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x37\x3D\x35\x35\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x37\x29\x36\x2F\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x2F\x34\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x39\x23\x38\x3F\x28\x3C\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x3B\x3C\x2F\x2B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x38\x28\x3F\x3B\x2E\x32" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x3C\x3B\x39\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x3D\x35\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x30\x35\x39\x31\x33\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x36\x3F\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x37\x33\x36\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x37\x2F\x34\x39\x32\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x34\x33\x38\x38\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x29\x31\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x29\x36\x3B\x2A\x2A\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x29\x37\x35\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x29\x2F\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x2C\x3B\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x39\x31\x20" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x31\x32\x3F\x3B\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x2A\x29\x32\x3B\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x33\x2A\x29\x32\x33\x3E\x33\x35\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x36\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x35\x2F\x38\x36\x3F\x3E\x33\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x2F\x37\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x2F\x37\x38\x3B\x28\x28\x3B\x29\x29\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3E\x2F\x37\x38\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x3B\x39\x31\x2F\x32\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x3B\x2E\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x39\x2F\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x23\x3F\x3B\x32" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x31\x23\x35\x2F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x39\x2C\x31\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x3F\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x38\x34\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x38\x2F\x34\x34\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x31\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x35\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x35\x35\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x35\x35\x31\x2F\x32" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x35\x2E\x32\x3F\x28\x37\x2F\x39\x31\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x39\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x39\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x39\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x39\x22" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x3D\x3D\x3F\x28\x20" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x3D\x3D\x33\x34\x3D\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x3D\x36\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x39\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x32\x3F\x3B\x3E\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x2F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x31\x2D\x33\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2F\x2E\x32\x3B\x37\x2F\x39\x31\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x2C\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x3C\x22\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x32\x35\x28\x29\x3F\x29\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x3B\x39\x31\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x38\x3B\x3D\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x3F\x3B\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x29\x3B\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x30\x33\x20\x20\x29\x2E\x3B\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x31\x33\x3E\x3E\x33\x3E\x3E\x36\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x31\x33\x29\x29\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x31\x33\x29\x29\x37\x23\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x36\x35\x36\x33\x39\x35\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x3B\x28\x31\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x3C\x35\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x3C\x2F\x39\x39\x31\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x3C\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3B\x3C\x2F\x39\x39" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x3F\x3C\x3C\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x3C\x3B\x39\x31\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x3C\x3F\x39\x31\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x3C\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3F\x28\x3C\x2F\x39\x39\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x35\x2E\x32\x3C\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x2F\x3E\x3E\x3F\x28\x3C\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x2F\x3C\x3E\x33\x2C\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x2F\x3C\x3E\x33\x2C\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x2F\x3C\x3C\x3E\x33\x2C\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x37\x2F\x3C\x3C\x33\x34\x3E\x33\x2C\x33\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x35\x39\x2E\x35\x2A\x2F\x29\x29\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x32\x2F\x39" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x32\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x32\x2F\x2B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x32\x2C\x39\x31\x33\x34\x3D\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x34\x31\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x29\x29\x36\x3F\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x29\x29\x36\x33\x39\x31\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x29\x29\x23\x36\x33\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x29\x29\x23\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x29\x29\x23\x2D\x32\x33\x2A\x2A\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x20\x20\x33\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2A\x2F\x20\x20\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x3B\x2F\x29\x3B\x3D\x3F\x30\x35\x39\x31\x3F\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x32\x3F\x33\x29\x2E\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x32\x33\x2A\x3E\x33\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x32\x33\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x32\x35\x2E\x3B\x39\x35\x34" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x2E\x2F\x2A\x33\x3E\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x2F\x39\x31\x37\x23\x39\x35\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x29\x2F\x39\x31\x37\x23\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2E\x3B\x28\x3E\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_anywhere, "\x2D\x33\x29\x3F\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x39\x3B\x2D\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x39\x2F\x37\x38\x3B\x36\x36" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x39\x2F\x37\x20" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x39\x2F\x2F\x34\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3E\x3B\x28\x31\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x3B\x2E\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x2F\x3D\x3D\x3F\x3E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x2F\x3D\x3D\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x2F\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x2F\x2B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x3C\x2F\x22" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x3C\x3F\x28" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x3C\x3F\x28\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x3C\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x3C\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x3C\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x35\x3C\x35" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x37\x35\x3C\x35\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x29\x2E\x3C\x2F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_start, "\x20\x35\x35\x2A\x32\x33\x36" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3B\x29\x29\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3B\x20\x20" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x38\x2F\x36\x36\x29\x32\x33" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x3B\x3B\x3B\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x3B\x39\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x3B\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x35\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x35\x39\x31\x36\x3F\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x35\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x2F\x37" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x2F\x37\x37\x33\x34\x3D" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x39\x2F\x37\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3E\x33\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3E\x33\x39\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3E\x33\x3E\x3E\x36\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3E\x33\x31\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x3B\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x3B\x28\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x3F\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x33\x39\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x35\x35\x31" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x2F\x39" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x2F\x39\x39" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x3C\x2F\x39\x39\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x30\x3B\x39\x31\x3B\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x30\x3B\x39\x31\x3B\x29\x29\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x30\x33\x20\x20" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x30\x33\x20\x20\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x36\x35\x36\x33" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x37\x2F\x3C\x3C" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x2A\x2F\x29\x29\x33\x3F" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x2A\x2F\x29\x29\x33\x3F\x29" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x2A\x2F\x29\x29\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x2A\x2F\x2F\x29\x29\x23" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x29\x32\x3B\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x29\x32\x3F\x3F\x3F\x3F\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x29\x32\x3F\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x29\x32\x33\x3B\x2E" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x29\x32\x35\x2E\x3B" },
|
||||
{ _text_filter_swearing, 3, _text_filter_whole, "\x2E\x33\x2E\x29" },
|
||||
};
|
||||
|
||||
static char const *const text_filter_allowed_words[] =
|
||||
{
|
||||
"agapornis",
|
||||
"assess",
|
||||
"assesses",
|
||||
"bereshith",
|
||||
"brushite",
|
||||
"chashitsu",
|
||||
"cushite",
|
||||
"cushitic",
|
||||
"elkoshite",
|
||||
"epornitic",
|
||||
"epornitically",
|
||||
"girgashite",
|
||||
"kaneshite",
|
||||
"koreishite",
|
||||
"mackintoshite",
|
||||
"marshite",
|
||||
"matsushita",
|
||||
"metabrushite",
|
||||
"mishit",
|
||||
"mishits",
|
||||
"mishitting",
|
||||
"niggard",
|
||||
"nonporness",
|
||||
"peshito",
|
||||
"phage",
|
||||
"phages",
|
||||
"placuntitis",
|
||||
"placuntoma",
|
||||
"poorness",
|
||||
"poornesses",
|
||||
"rappist",
|
||||
"scunthorpe",
|
||||
"shiitake",
|
||||
"shiite",
|
||||
"shiites",
|
||||
"shiitic",
|
||||
"shitake",
|
||||
"shittah",
|
||||
"shittahs",
|
||||
"shitterton",
|
||||
"shittim",
|
||||
"shittims",
|
||||
"shittimwood",
|
||||
"snigger",
|
||||
"spoorn",
|
||||
"unniggard",
|
||||
"unporness",
|
||||
"washita",
|
||||
"wiggeries",
|
||||
"wiggery",
|
||||
};
|
||||
@@ -38,15 +38,52 @@ enum halo_keyboard_action
|
||||
/* (voice chat's, which the game itself does not read:
|
||||
halo_push_to_talk_held) */
|
||||
HALO_KEYBOARD_PUSH_TO_TALK,
|
||||
/* (the text chat's, which the game itself does not read: a line to
|
||||
everyone, or to the team: port/linux/game/network_chat.c) */
|
||||
HALO_KEYBOARD_CHAT,
|
||||
HALO_KEYBOARD_TEAM_CHAT,
|
||||
NUMBER_OF_HALO_KEYBOARD_ACTIONS
|
||||
};
|
||||
|
||||
/* the actions the keyboard and mouse hold for the player on the controller
|
||||
(a bit for each halo_keyboard_action): theirs is the first's; none while a
|
||||
menu or the console is up */
|
||||
menu or the console is up, or a chat line is typed */
|
||||
unsigned long halo_keyboard_actions(short controller_index);
|
||||
/* whether voice chat's push to talk is held (controls.push_to_talk), in the
|
||||
game and in the menus alike */
|
||||
int halo_push_to_talk_held(void);
|
||||
|
||||
/* the first controller's buttons (with the touch controls'), as the text
|
||||
chat's on-screen keyboard reads them: a bit for each (port/linux/game/
|
||||
network_chat.c). The game gets none of the controller while that keyboard is
|
||||
up (network_chat_keyboard_open), nor the touch controls' stick and look */
|
||||
enum halo_chat_pad_button
|
||||
{
|
||||
HALO_CHAT_PAD_UP,
|
||||
HALO_CHAT_PAD_DOWN,
|
||||
HALO_CHAT_PAD_LEFT,
|
||||
HALO_CHAT_PAD_RIGHT,
|
||||
HALO_CHAT_PAD_A,
|
||||
HALO_CHAT_PAD_B,
|
||||
HALO_CHAT_PAD_X,
|
||||
HALO_CHAT_PAD_Y,
|
||||
HALO_CHAT_PAD_START,
|
||||
/* the left stick, pushed most of the way */
|
||||
HALO_CHAT_PAD_STICK_UP,
|
||||
HALO_CHAT_PAD_STICK_DOWN,
|
||||
HALO_CHAT_PAD_STICK_LEFT,
|
||||
HALO_CHAT_PAD_STICK_RIGHT,
|
||||
NUMBER_OF_HALO_CHAT_PAD_BUTTONS
|
||||
};
|
||||
|
||||
unsigned long halo_chat_pad_buttons(void);
|
||||
/* the taps on the touchscreen outside the menus since the last call while
|
||||
that keyboard is up, and where the latest was (0 to 1 across and down the
|
||||
window) */
|
||||
int halo_chat_taps(float *x, float *y);
|
||||
/* whether the touch controls hold the screen's bottom left, where the chat
|
||||
then goes at the top left: on Android, and in a browser once its touch
|
||||
controls have been used */
|
||||
int halo_chat_touch_layout(void);
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
version 29
|
||||
bound CHAT_TEXT_SIZE 64
|
||||
bound DISCORD_ID_SIZE 24
|
||||
bound DISCORD_NAME_SIZE 40
|
||||
bound DISTRIBUTED_INPUT_HISTORY 4
|
||||
@@ -41,6 +42,9 @@ enum _distributed_actor_super_camouflaged_bit 5
|
||||
enum _distributed_message_actor_damage 73
|
||||
enum _distributed_message_actor_states 64
|
||||
enum _distributed_message_batch 16
|
||||
enum _distributed_message_chat_config 89
|
||||
enum _distributed_message_chat_down 88
|
||||
enum _distributed_message_chat_up 87
|
||||
enum _distributed_message_client_identity 18
|
||||
enum _distributed_message_client_ready 9
|
||||
enum _distributed_message_coop_device_groups 68
|
||||
@@ -218,6 +222,8 @@ struct distributed_actor_damage 96a57e13e2b8
|
||||
struct distributed_actor_damage_message f985e899a708
|
||||
struct distributed_actor_state 8bd5e771659d
|
||||
struct distributed_actor_state_message 51a56e04a536
|
||||
struct distributed_chat_config dfa4e32efe1e
|
||||
struct distributed_chat_line cdab1468ffe0
|
||||
struct distributed_client_identity 4d9e62025616
|
||||
struct distributed_coop_device_group 4aa3499be2cc
|
||||
struct distributed_coop_device_groups_message b96ad0030ccc
|
||||
|
||||
@@ -2472,6 +2472,11 @@ static int parse_invite(const char *text, unsigned char *host_hash, unsigned cha
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the host of the public game this machine joined from the server browser
|
||||
(p2p_join_listing), till another invite is joined: its identifier */
|
||||
static unsigned char listed_host[P2P_IDENTIFIER_SIZE];
|
||||
static int listed_host_known;
|
||||
|
||||
/* under p2p_lock: parse_invite's result */
|
||||
static int join_invite(const char *text)
|
||||
{
|
||||
@@ -2484,6 +2489,8 @@ static int join_invite(const char *text)
|
||||
"cannot join");
|
||||
if (parsed <= 0)
|
||||
return parsed;
|
||||
/* (any invite's game is no listed one, unless p2p_join_listing says) */
|
||||
listed_host_known = 0;
|
||||
p2p_identifier_from_hash(hash, host);
|
||||
if (!memcmp(host, identifier, P2P_IDENTIFIER_SIZE))
|
||||
return 1;
|
||||
@@ -2641,6 +2648,37 @@ void p2p_join_code_clear_status(void)
|
||||
pthread_mutex_unlock(&p2p_lock);
|
||||
}
|
||||
|
||||
int p2p_join_listing(const struct p2p_listing *listing)
|
||||
{
|
||||
unsigned char hash[P2P_KEY_HASH_SIZE], token[P2P_TOKEN_SIZE];
|
||||
|
||||
if (!p2p_join_invite(listing->invite))
|
||||
return 0;
|
||||
/* (its host as the invite names it, as the tunnel knows its peers) */
|
||||
pthread_mutex_lock(&p2p_lock);
|
||||
if (parse_invite(listing->invite, hash, token) > 0)
|
||||
{
|
||||
p2p_identifier_from_hash(hash, listed_host);
|
||||
listed_host_known = 1;
|
||||
}
|
||||
pthread_mutex_unlock(&p2p_lock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int p2p_joined_listed_host(void)
|
||||
{
|
||||
struct peer *peer;
|
||||
int reached;
|
||||
|
||||
if (!p2p.running)
|
||||
return 0;
|
||||
pthread_mutex_lock(&p2p_lock);
|
||||
peer = listed_host_known ? find_peer(listed_host) : NULL;
|
||||
reached = peer && peer->connected;
|
||||
pthread_mutex_unlock(&p2p_lock);
|
||||
return reached;
|
||||
}
|
||||
|
||||
void p2p_invite_received(const char *text)
|
||||
{
|
||||
/* (an older version's is logged as such; a join code is looked up,
|
||||
|
||||
@@ -149,6 +149,9 @@ in everyone's server browser: Create Game's PUBLIC; a private game is
|
||||
reached only by its invite. Going private makes a new invite, if the old one
|
||||
was listed */
|
||||
void p2p_set_hosting_public(int public);
|
||||
/* whether the game this machine hosts is listed in everyone's server
|
||||
browser (PUBLIC, and network.public_lobby): the text chat is off in one */
|
||||
int p2p_hosting_listed(void);
|
||||
/* the password of the game hosted for the internet (Server Setup's
|
||||
PASSWORD; NULL or empty: none): its listing lets only those who know it
|
||||
join from the server browser (its invite link still joins it). Setting or
|
||||
@@ -201,6 +204,14 @@ struct p2p_listing
|
||||
unsigned char signing_key[P2P_LISTING_SIGNING_KEY_SIZE];
|
||||
unsigned char sealed_token[P2P_LISTING_SEALED_TOKEN_SIZE];
|
||||
};
|
||||
/* joins a public game the server browser found (p2p_join_invite with its
|
||||
invite), remembering its host: nonzero if it held an invite */
|
||||
int p2p_join_listing(const struct p2p_listing *listing);
|
||||
/* whether this machine is in the public game it joined from the server
|
||||
browser: the tunnel still reaches its host, and no other invite was joined
|
||||
since. Such a game has no text chat, whatever its host says
|
||||
(port/linux/game/network_chat.c) */
|
||||
int p2p_joined_listed_host(void);
|
||||
/* a copy of the public games found, in the order shown (the most players
|
||||
first; then those not failed, the open ones, by name); returns their count */
|
||||
int p2p_lobby_games(struct p2p_listing *games, int maximum_count);
|
||||
|
||||
@@ -726,6 +726,16 @@ void p2p_set_hosting_public(int public)
|
||||
pthread_mutex_unlock(&p2p_lock);
|
||||
}
|
||||
|
||||
int p2p_hosting_listed(void)
|
||||
{
|
||||
int listed;
|
||||
|
||||
pthread_mutex_lock(&p2p_lock);
|
||||
listed = lobby.public && config_boolean("network.public_lobby");
|
||||
pthread_mutex_unlock(&p2p_lock);
|
||||
return listed;
|
||||
}
|
||||
|
||||
void p2p_set_hosting_password(const char *password)
|
||||
{
|
||||
unsigned char key[P2P_PASSWORD_KEY_SIZE];
|
||||
|
||||
@@ -536,6 +536,11 @@ static const struct config_setting config_settings[] =
|
||||
"Save a PNG screenshot beside maps/ (press once per capture)." },
|
||||
{ "controls.push_to_talk", _config_string, "\"V\"", "HALO_KEY_PUSH_TO_TALK", _environment_value, _platform_all,
|
||||
"Voice chat: talk while it is held (audio.voice_chat \"push_to_talk\")." },
|
||||
{ "controls.chat", _config_string, "\"T\"", "HALO_KEY_CHAT", _environment_value, _platform_all,
|
||||
"Network games' text chat: type a line to everyone (Enter sends it,\n"
|
||||
"Escape lets it go)." },
|
||||
{ "controls.team_chat", _config_string, "\"Y\"", "HALO_KEY_TEAM_CHAT", _environment_value, _platform_all,
|
||||
"Network games' text chat: type a line to your team." },
|
||||
|
||||
{ "game.console_log", _config_string, "\"important\"", "HALO_CONSOLE_LOG", _environment_value, _platform_all,
|
||||
"What the game's console shows on screen of what it logs: \"important\"\n"
|
||||
@@ -547,6 +552,13 @@ static const struct config_setting config_settings[] =
|
||||
{ "game.language", _config_string, "\"\"", "HALO_LANGUAGE", _environment_value, _platform_all,
|
||||
"The language the game asks the Xbox for: \"ja\", \"de\", \"fr\", \"es\" or \"it\";\n"
|
||||
"empty for English. The game data decides what is translated." },
|
||||
{ "display.text_chat", _config_boolean, "true", "HALO_TEXT_CHAT", _environment_value, _platform_all,
|
||||
"Show the text chat of network games: false hides its lines and keeps\n"
|
||||
"its keys (and a controller's D-pad Up) from opening it, as for purists\n"
|
||||
"and streamers." },
|
||||
{ "display.chat_style", _config_string, "\"colors\"", "HALO_CHAT_STYLE", _environment_value, _platform_all,
|
||||
"The text chat's colours: \"colors\" (names in their team's colour, the\n"
|
||||
"text a pale blue) or \"white\" (all white, as Custom Edition)." },
|
||||
{ "game.enhanced_animations", _config_boolean, "true", "HALO_ENHANCED_ANIMATIONS", _environment_value, _platform_all,
|
||||
"The player bipeds' grenade throws keep their legs moving (crouched,\n"
|
||||
"in the air and in a vehicle's seat too), riders' hands leave the grips\n"
|
||||
@@ -643,6 +655,10 @@ static const struct config_setting config_settings[] =
|
||||
_platform_all,
|
||||
"Hosting: how near (world units: 1 is about 3 metres) a player must be\n"
|
||||
"to be heard by proximity voice chat (5 to 100)." },
|
||||
{ "network.text_chat", _config_string, "\"on\"", "HALO_NET_TEXT_CHAT", _environment_value, _platform_all,
|
||||
"Hosting: the text chat: \"on\" (links in lines are refused), \"links\"\n"
|
||||
"(links allowed) or \"off\", in either case. Always off in a game listed\n"
|
||||
"in the server browser (a public internet game)." },
|
||||
{ "network.votekick", _config_boolean, "true", "HALO_NET_VOTEKICK", _environment_value, _platform_all,
|
||||
"Hosting: let the players vote to kick a player (the scoreboard's\n"
|
||||
"right-click, or the console's votekick). More than half of the players\n"
|
||||
@@ -663,7 +679,8 @@ static const struct config_setting config_settings[] =
|
||||
{ "network.map_share_upload", _config_integer, "1024", "HALO_NET_MAP_SHARE_UPLOAD", _environment_value,
|
||||
_platform_all,
|
||||
"Hosting: the most kilobytes a second the host sends of maps (16 to\n"
|
||||
"65536), so that the game's own traffic keeps the rest of the upload." },
|
||||
"20480: 20 MB/s), so that the game's own traffic keeps the rest of the\n"
|
||||
"upload." },
|
||||
{ "network.map_seed", _config_boolean, "true", "HALO_NET_MAP_SEED", _environment_value, _platform_all,
|
||||
"Playing in another's game: help send its map to players who join\n"
|
||||
"without it, as a torrent's peers do (the pieces this machine has, at\n"
|
||||
@@ -671,7 +688,7 @@ static const struct config_setting config_settings[] =
|
||||
{ "network.map_seed_upload", _config_integer, "256", "HALO_NET_MAP_SEED_UPLOAD", _environment_value,
|
||||
_platform_all,
|
||||
"Playing in another's game: the most kilobytes a second this machine\n"
|
||||
"sends of maps to other players (16 to 65536)." },
|
||||
"sends of maps to other players (16 to 10240: 10 MB/s)." },
|
||||
{ "network.map_download", _config_boolean, "true", "HALO_NET_MAP_DOWNLOAD", _environment_value, _platform_all,
|
||||
"Joining a game on a Custom Edition map this machine does not have:\n"
|
||||
"download it (and the resource maps it needs) from the game's players\n"
|
||||
@@ -734,6 +751,18 @@ static const struct config_setting config_settings[] =
|
||||
{ "update.auto", _config_boolean, "true", "HALO_UPDATE_AUTO", _environment_value, _platform_all,
|
||||
"Look for a new version when the game starts, and offer to update to it;\n"
|
||||
"false never looks (the game's \"Do not ask again\" writes false here)." },
|
||||
{ "streamer.enabled", _config_boolean, "false", "HALO_STREAMER_MODE", _environment_value, _platform_all,
|
||||
"Hide offensive words in names and text from other players, maps and mods\n"
|
||||
"as stars, at the levels below (Settings > Network Setup > Streamer Mode)." },
|
||||
{ "streamer.slurs", _config_string, "\"mild\"", "HALO_STREAMER_SLURS", _environment_value, _platform_all,
|
||||
"With streamer.enabled, the slurs (race, sexuality, gender, disability)\n"
|
||||
"hidden: \"off\", \"severe\", \"strong\" (and severe) or \"mild\" (all)." },
|
||||
{ "streamer.swearing", _config_string, "\"strong\"", "HALO_STREAMER_SWEARING", _environment_value, _platform_all,
|
||||
"With streamer.enabled, the swearing and sexual words hidden: \"off\",\n"
|
||||
"\"severe\", \"strong\" (and severe) or \"mild\" (all)." },
|
||||
{ "streamer.insults", _config_string, "\"off\"", "HALO_STREAMER_INSULTS", _environment_value, _platform_all,
|
||||
"With streamer.enabled, the insults that are not slurs hidden: \"off\",\n"
|
||||
"\"severe\", \"strong\" (and severe) or \"mild\" (all)." },
|
||||
{ "crash_reports.upload", _config_string, "\"ask\"", "HALO_CRASH_REPORTS", _environment_value, _platform_windows,
|
||||
"Send a report of each crash (a minidump and halo.log) to the developers'\n"
|
||||
"Sentry project (port/windows/src/win32_crash.c): \"yes\" sends them, \"no\"\n"
|
||||
@@ -761,6 +790,15 @@ static const struct config_setting config_settings[] =
|
||||
{ "debug.network_test_pickup", _config_real, "0.0", "HALO_NETWORK_TEST_PICKUP", _environment_value, _platform_all,
|
||||
"This many seconds into an automated test game the host stands its last\n"
|
||||
"player on a weapon, which a joining player then picks up; 0 never." },
|
||||
{ "debug.network_test_chat", _config_real, "0.0", "HALO_NETWORK_TEST_CHAT", _environment_value, _platform_all,
|
||||
"This many seconds into an automated test game each machine's player\n"
|
||||
"says a chat line to everyone, then to the team and to the vehicle (the\n"
|
||||
"host seats the last two players in one first), then the host mutes and\n"
|
||||
"unmutes a player, refuses a link and turns the chat off, and the\n"
|
||||
"clients type on the on-screen keyboard (port/linux/NETCODE.md); 0 never." },
|
||||
{ "debug.network_test_name", _config_string, "\"\"", "HALO_NETWORK_TEST_NAME", _environment_value, _platform_all,
|
||||
"The name this machine's player takes in an automated test game (ASCII);\n"
|
||||
"empty keeps its profile's." },
|
||||
{ "debug.network_test_pickup_weapon", _config_string, "\"\"", "HALO_NETWORK_TEST_PICKUP_WEAPON", _environment_value,
|
||||
_platform_all,
|
||||
"The weapon network_test_pickup stands the player on: the first whose tag\n"
|
||||
|
||||
@@ -18,6 +18,7 @@ and the debug keyboard that the game's console reads.
|
||||
#include "port_mods.h"
|
||||
#include "xiso.h"
|
||||
#include "touch_input.h"
|
||||
#include "../game/text_filter.h"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <stdio.h>
|
||||
@@ -1282,6 +1283,9 @@ void platform_show_message(const char *title, const char *message)
|
||||
pthread_mutex_lock(&platform_message_lock);
|
||||
snprintf(platform_message_title, sizeof(platform_message_title), "%s", title);
|
||||
snprintf(platform_message_text, sizeof(platform_message_text), "%s", message);
|
||||
/* (streamer mode's words hidden here too: a map's or a mod's name) */
|
||||
text_filter_utf8(platform_message_title);
|
||||
text_filter_utf8(platform_message_text);
|
||||
platform_message_pending = TRUE;
|
||||
pthread_mutex_unlock(&platform_message_lock);
|
||||
}
|
||||
@@ -1294,10 +1298,36 @@ void web_js_ask(const char *title, const char *text, const char *labels);
|
||||
|
||||
int platform_ask(const char *title, const char *text, const char *const *labels, int count, int default_index)
|
||||
{
|
||||
/* (streamer mode's words hidden here too: mods' names) */
|
||||
static char shown_title[128];
|
||||
static char shown_text[4096];
|
||||
static char shown_labels[3][128];
|
||||
const char *shown[3];
|
||||
int index;
|
||||
#ifdef HALO_WEB
|
||||
char joined[512] = "";
|
||||
int index;
|
||||
#else
|
||||
SDL_MessageBoxButtonData buttons[3];
|
||||
SDL_MessageBoxData question;
|
||||
int answer = -1;
|
||||
#endif
|
||||
|
||||
if (count > 3)
|
||||
count = 3;
|
||||
snprintf(shown_title, sizeof(shown_title), "%s", title);
|
||||
snprintf(shown_text, sizeof(shown_text), "%s", text);
|
||||
text_filter_utf8(shown_title);
|
||||
text_filter_utf8(shown_text);
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
snprintf(shown_labels[index], sizeof(shown_labels[index]), "%s", labels[index]);
|
||||
text_filter_utf8(shown_labels[index]);
|
||||
shown[index] = shown_labels[index];
|
||||
}
|
||||
title = shown_title;
|
||||
text = shown_text;
|
||||
labels = shown;
|
||||
#ifdef HALO_WEB
|
||||
/* (the page's dialog: the game's thread waits for the player there, as
|
||||
SDL's box would, which a page's worker cannot show) */
|
||||
for (index = 0; index < count; index++)
|
||||
@@ -1313,13 +1343,6 @@ int platform_ask(const char *title, const char *text, const char *const *labels,
|
||||
(void)default_index;
|
||||
return __atomic_load_n(&web_shared[_web_answer], __ATOMIC_SEQ_CST);
|
||||
#else
|
||||
SDL_MessageBoxButtonData buttons[3];
|
||||
SDL_MessageBoxData question;
|
||||
int answer = -1;
|
||||
int index;
|
||||
|
||||
if (count > 3)
|
||||
count = 3;
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
buttons[index].flags = index == default_index ?
|
||||
|
||||
@@ -169,6 +169,25 @@ void touch_input_menu_read(struct platform_ui_pointer *pointer)
|
||||
pointer->touch = TRUE;
|
||||
}
|
||||
|
||||
/* port/linux/game/network_chat.c: its on-screen keyboard is up, which
|
||||
takes the taps outside the menus */
|
||||
extern unsigned char network_chat_keyboard_open(void);
|
||||
|
||||
/* the taps for that keyboard since it last took them, and the latest's
|
||||
place (0 to 1 of the window) */
|
||||
static int chat_taps;
|
||||
static float chat_tap_x, chat_tap_y;
|
||||
|
||||
int touch_input_chat_taps(float *x, float *y)
|
||||
{
|
||||
int taps = chat_taps;
|
||||
|
||||
*x = chat_tap_x;
|
||||
*y = chat_tap_y;
|
||||
chat_taps = 0;
|
||||
return taps;
|
||||
}
|
||||
|
||||
void touch_input_gamepad(XINPUT_GAMEPAD *pad)
|
||||
{
|
||||
/* outside the menus the touchscreen only skips a cinematic that can be
|
||||
@@ -179,7 +198,17 @@ void touch_input_gamepad(XINPUT_GAMEPAD *pad)
|
||||
|
||||
menu_setup();
|
||||
touch_menu_read(&menu, &output);
|
||||
if (output.clicks && touch_game_cinematic_skippable())
|
||||
/* (or, while the text chat's on-screen keyboard is up, its keys) */
|
||||
if (output.clicks && network_chat_keyboard_open())
|
||||
{
|
||||
int width = 0, height = 0;
|
||||
|
||||
platform_video_drawable_size(&width, &height);
|
||||
chat_taps += output.clicks;
|
||||
chat_tap_x = width > 0 ? output.click_x / (float)width : 0.0f;
|
||||
chat_tap_y = height > 0 ? output.click_y / (float)height : 0.0f;
|
||||
}
|
||||
else if (output.clicks && touch_game_cinematic_skippable())
|
||||
{
|
||||
skip_polls = TOUCH_PRESS_POLLS;
|
||||
platform_log("touch: A pressed to skip a cinematic");
|
||||
@@ -257,9 +286,11 @@ void touch_input_controls(XINPUT_GAMEPAD *pad, int menus)
|
||||
int index;
|
||||
|
||||
/* (the controls show only in a game: not while it starts, at the main
|
||||
menu, in a menu or during a cinematic) */
|
||||
menu, in a menu or during a cinematic; nor while the text chat's
|
||||
on-screen keyboard is up, whose keys the fingers then tap) */
|
||||
host_touch_scene(_touch_scene_known | touch_controls_setting() |
|
||||
(menus || !touch_game_playing() || touch_game_cinematic_playing() ? _touch_scene_menus : 0));
|
||||
(menus || !touch_game_playing() || touch_game_cinematic_playing() || network_chat_keyboard_open() ?
|
||||
_touch_scene_menus : 0));
|
||||
/* (the profile's mapping, for the buttons' names; only when it changes) */
|
||||
touch_game_button_controls(bindings);
|
||||
if (!bindings_known || memcmp(bindings, bindings_sent, sizeof(bindings)))
|
||||
|
||||
@@ -34,6 +34,10 @@ void touch_input_menu_read(struct platform_ui_pointer *pointer);
|
||||
/* outside the menus, presses A for a few polls after a tap when a
|
||||
cinematic can be skipped (the on-screen controls: touch_input_controls) */
|
||||
void touch_input_gamepad(XINPUT_GAMEPAD *pad);
|
||||
/* the taps outside the menus since the last call while the text chat's
|
||||
on-screen keyboard is up (port/linux/game/network_chat.c), and where the
|
||||
latest was, 0 to 1 across and down the window */
|
||||
int touch_input_chat_taps(float *x, float *y);
|
||||
|
||||
#if defined(HALO_ANDROID) || defined(HALO_WEB)
|
||||
/* the on-screen touch controls (port/android/app/.../TouchControls.java; in
|
||||
|
||||
@@ -57,6 +57,12 @@ drive the controller.
|
||||
|
||||
/* main/console.c */
|
||||
extern unsigned char console_is_active(void);
|
||||
/* port/linux/game/network_chat.c: a chat line is typed, which takes the
|
||||
keyboard as the console does */
|
||||
extern unsigned char network_chat_typing(void);
|
||||
/* ... and its on-screen keyboard is up, which takes the first controller
|
||||
and the touch controls' stick and look */
|
||||
extern unsigned char network_chat_keyboard_open(void);
|
||||
/* port/linux/game/menu_functions.c: two or more players on this machine
|
||||
(co-op, or split screen in a network game) */
|
||||
extern unsigned char pc_menu_split_players(void);
|
||||
@@ -169,6 +175,96 @@ static void touch_used(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ---------- the text chat's on-screen keyboard (halo_keyboard.h) */
|
||||
|
||||
/* the first controller's buttons, as each read of it found them */
|
||||
static unsigned long chat_pad;
|
||||
|
||||
static void chat_pad_record(const XINPUT_GAMEPAD *pad)
|
||||
{
|
||||
/* (an analog button pressed half way; the stick most of the way) */
|
||||
enum { PRESSED = 0x80, PUSHED = 22000 };
|
||||
unsigned long buttons = 0;
|
||||
|
||||
if (pad->wButtons & XINPUT_GAMEPAD_DPAD_UP) buttons |= 1UL << HALO_CHAT_PAD_UP;
|
||||
if (pad->wButtons & XINPUT_GAMEPAD_DPAD_DOWN) buttons |= 1UL << HALO_CHAT_PAD_DOWN;
|
||||
if (pad->wButtons & XINPUT_GAMEPAD_DPAD_LEFT) buttons |= 1UL << HALO_CHAT_PAD_LEFT;
|
||||
if (pad->wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) buttons |= 1UL << HALO_CHAT_PAD_RIGHT;
|
||||
if (pad->wButtons & XINPUT_GAMEPAD_START) buttons |= 1UL << HALO_CHAT_PAD_START;
|
||||
if (pad->bAnalogButtons[XINPUT_GAMEPAD_A] >= PRESSED) buttons |= 1UL << HALO_CHAT_PAD_A;
|
||||
if (pad->bAnalogButtons[XINPUT_GAMEPAD_B] >= PRESSED) buttons |= 1UL << HALO_CHAT_PAD_B;
|
||||
if (pad->bAnalogButtons[XINPUT_GAMEPAD_X] >= PRESSED) buttons |= 1UL << HALO_CHAT_PAD_X;
|
||||
if (pad->bAnalogButtons[XINPUT_GAMEPAD_Y] >= PRESSED) buttons |= 1UL << HALO_CHAT_PAD_Y;
|
||||
if (pad->sThumbLY > PUSHED) buttons |= 1UL << HALO_CHAT_PAD_STICK_UP;
|
||||
if (pad->sThumbLY < -PUSHED) buttons |= 1UL << HALO_CHAT_PAD_STICK_DOWN;
|
||||
if (pad->sThumbLX < -PUSHED) buttons |= 1UL << HALO_CHAT_PAD_STICK_LEFT;
|
||||
if (pad->sThumbLX > PUSHED) buttons |= 1UL << HALO_CHAT_PAD_STICK_RIGHT;
|
||||
chat_pad = buttons;
|
||||
}
|
||||
|
||||
unsigned long halo_chat_pad_buttons(void)
|
||||
{
|
||||
return chat_pad;
|
||||
}
|
||||
|
||||
int halo_chat_taps(float *x, float *y)
|
||||
{
|
||||
return touch_input_chat_taps(x, y);
|
||||
}
|
||||
|
||||
int halo_chat_touch_layout(void)
|
||||
{
|
||||
#if defined(HALO_ANDROID)
|
||||
/* (port: not in VR, which has no touch controls in the way) */
|
||||
return !halo_vr_active();
|
||||
#elif defined(HALO_WEB)
|
||||
int used;
|
||||
|
||||
pthread_mutex_lock(&mouse_lock);
|
||||
used = touch_aimed_ms != 0;
|
||||
pthread_mutex_unlock(&mouse_lock);
|
||||
return used;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* the first controller's buttons held as the on-screen keyboard closed (the
|
||||
B that closed it, the Start or the A that sent the line), which the game
|
||||
gets none of till each is let go: it would see a new press of it, a pause
|
||||
menu opened, a melee, a jump (the triggers are analog buttons too) */
|
||||
static WORD chat_held_buttons;
|
||||
static unsigned char chat_held_analog;
|
||||
|
||||
static void chat_pad_hold_over(XINPUT_GAMEPAD *pad)
|
||||
{
|
||||
int index;
|
||||
|
||||
if (network_chat_keyboard_open())
|
||||
{
|
||||
chat_held_buttons = pad->wButtons;
|
||||
chat_held_analog = 0;
|
||||
for (index = 0; index < 8; index++)
|
||||
{
|
||||
if (pad->bAnalogButtons[index])
|
||||
chat_held_analog |= (unsigned char)(1 << index);
|
||||
}
|
||||
memset(pad, 0, sizeof(*pad));
|
||||
return;
|
||||
}
|
||||
chat_held_buttons &= pad->wButtons;
|
||||
pad->wButtons &= (WORD)~chat_held_buttons;
|
||||
for (index = 0; index < 8; index++)
|
||||
{
|
||||
if (!(chat_held_analog & (1 << index)))
|
||||
continue;
|
||||
if (pad->bAnalogButtons[index])
|
||||
pad->bAnalogButtons[index] = 0;
|
||||
else
|
||||
chat_held_analog &= (unsigned char)~(1 << index);
|
||||
}
|
||||
}
|
||||
|
||||
/* the touch controls' stick as the player's movement (input_abstraction.c's
|
||||
keyboard_controls_update), forward and strafe -1..1, whatever the
|
||||
profile's sticks do; nonzero while it is pushed. Nothing but on Android and
|
||||
@@ -181,8 +277,12 @@ int halo_linux_touch_move(short controller_index, float *forward, float *strafe)
|
||||
return FALSE;
|
||||
#if defined(HALO_ANDROID) || defined(HALO_WEB)
|
||||
/* (port: not in VR, where the touch controls are off) */
|
||||
if (halo_vr_active() || !touch_input_move(forward, strafe))
|
||||
if (halo_vr_active() || !touch_input_move(forward, strafe) || network_chat_keyboard_open())
|
||||
{
|
||||
*forward = 0.0f;
|
||||
*strafe = 0.0f;
|
||||
return FALSE;
|
||||
}
|
||||
touch_used();
|
||||
return TRUE;
|
||||
#else
|
||||
@@ -208,6 +308,15 @@ int halo_linux_touch_look(short gamepad_index, float *yaw, float *pitch, float *
|
||||
if (halo_vr_active())
|
||||
return FALSE;
|
||||
touch_input_look(0.0022f, yaw, pitch, gyro_yaw, gyro_pitch);
|
||||
/* (none while the chat's on-screen keyboard is up: what was swiped is
|
||||
dropped, not saved for after) */
|
||||
if (network_chat_keyboard_open())
|
||||
{
|
||||
*yaw = 0.0f;
|
||||
*pitch = 0.0f;
|
||||
*gyro_yaw = 0.0f;
|
||||
*gyro_pitch = 0.0f;
|
||||
}
|
||||
if (*yaw == 0.0f && *pitch == 0.0f && *gyro_yaw == 0.0f && *gyro_pitch == 0.0f)
|
||||
return FALSE;
|
||||
touch_used();
|
||||
@@ -399,7 +508,8 @@ static void keys_held_over_switch(struct platform_input_state *input)
|
||||
{
|
||||
static unsigned char held[SDL_SCANCODE_COUNT];
|
||||
static int context = -1;
|
||||
int next_context = (input->menus != FALSE) | (text_typing ? 2 : 0) | (console_is_active() ? 4 : 0);
|
||||
int next_context = (input->menus != FALSE) | (text_typing ? 2 : 0) | (console_is_active() ? 4 : 0) |
|
||||
(network_chat_typing() ? 8 : 0);
|
||||
int scancode;
|
||||
|
||||
if (context != next_context)
|
||||
@@ -426,7 +536,7 @@ static const char *const binding_settings[NUMBER_OF_HALO_KEYBOARD_ACTIONS] =
|
||||
"controls.jump", "controls.crouch", "controls.fire", "controls.throw_grenade", "controls.melee",
|
||||
"controls.reload", "controls.zoom", "controls.switch_weapon", "controls.switch_grenade", "controls.action",
|
||||
"controls.flashlight", "controls.scoreboard", "controls.pause", "controls.screenshot",
|
||||
"controls.push_to_talk",
|
||||
"controls.push_to_talk", "controls.chat", "controls.team_chat",
|
||||
};
|
||||
|
||||
static const struct
|
||||
@@ -657,12 +767,49 @@ void test_input_hold_action(int hold)
|
||||
test_input_holding_action = hold;
|
||||
}
|
||||
|
||||
/* the automated tests (port/linux/game/network_test.c): the controller's
|
||||
buttons (halo_chat_pad_button bits) held for the reads to come, as a player
|
||||
types on the text chat's on-screen keyboard; the scripted player does
|
||||
nothing else while that keyboard is up */
|
||||
static unsigned long test_input_pressed;
|
||||
|
||||
void test_input_press(unsigned long buttons)
|
||||
{
|
||||
test_input_pressed = buttons;
|
||||
}
|
||||
|
||||
static void test_input_gamepad(XINPUT_GAMEPAD *pad)
|
||||
{
|
||||
static const WORD digital[] =
|
||||
{
|
||||
XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT,
|
||||
};
|
||||
static const int analog[] = { XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y };
|
||||
static int checked;
|
||||
static int seed = -1;
|
||||
static int looking;
|
||||
double t;
|
||||
int index;
|
||||
|
||||
for (index = 0; index < 4; index++)
|
||||
{
|
||||
if (test_input_pressed & (1UL << (HALO_CHAT_PAD_UP + index)))
|
||||
pad->wButtons |= digital[index];
|
||||
if (test_input_pressed & (1UL << (HALO_CHAT_PAD_A + index)))
|
||||
pad->bAnalogButtons[analog[index]] = 255;
|
||||
}
|
||||
if (test_input_pressed & (1UL << HALO_CHAT_PAD_START))
|
||||
pad->wButtons |= XINPUT_GAMEPAD_START;
|
||||
if (test_input_pressed & (1UL << HALO_CHAT_PAD_STICK_UP))
|
||||
pad->sThumbLY = 32000;
|
||||
if (test_input_pressed & (1UL << HALO_CHAT_PAD_STICK_DOWN))
|
||||
pad->sThumbLY = -32000;
|
||||
if (test_input_pressed & (1UL << HALO_CHAT_PAD_STICK_LEFT))
|
||||
pad->sThumbLX = -32000;
|
||||
if (test_input_pressed & (1UL << HALO_CHAT_PAD_STICK_RIGHT))
|
||||
pad->sThumbLX = 32000;
|
||||
if (network_chat_keyboard_open())
|
||||
return;
|
||||
|
||||
if (!checked)
|
||||
{
|
||||
@@ -1043,7 +1190,43 @@ static void vr_gamepad_state(XINPUT_GAMEPAD *pad)
|
||||
if (abs(value) > abs(pad->sThumbLX)) pad->sThumbLX = value;
|
||||
value = vr_stick(left->thumbstick[1]);
|
||||
if (abs(value) > abs(pad->sThumbLY)) pad->sThumbLY = value;
|
||||
if (left->buttons & HALO_XR_BUTTON_MENU) pad->wButtons |= XINPUT_GAMEPAD_START;
|
||||
{
|
||||
/* the menu button: a press pauses, as Start; held, the scores show
|
||||
while it is, as Back (the Quest's controllers have no button of
|
||||
their own for it). In the menus it is Start at once */
|
||||
static Uint64 menu_pressed_at, menu_pulse_until;
|
||||
static int menu_held_handled;
|
||||
Uint64 now = SDL_GetTicks();
|
||||
int down = (left->buttons & HALO_XR_BUTTON_MENU) != 0;
|
||||
|
||||
if (menus)
|
||||
{
|
||||
if (down)
|
||||
pad->wButtons |= XINPUT_GAMEPAD_START;
|
||||
menu_pressed_at = 0;
|
||||
}
|
||||
else if (down)
|
||||
{
|
||||
if (!menu_pressed_at)
|
||||
{
|
||||
menu_pressed_at = now;
|
||||
menu_held_handled = 0;
|
||||
}
|
||||
else if (now - menu_pressed_at >= 400)
|
||||
{
|
||||
pad->wButtons |= XINPUT_GAMEPAD_BACK;
|
||||
menu_held_handled = 1;
|
||||
}
|
||||
}
|
||||
else if (menu_pressed_at)
|
||||
{
|
||||
if (!menu_held_handled)
|
||||
menu_pulse_until = now + 100;
|
||||
menu_pressed_at = 0;
|
||||
}
|
||||
if (now < menu_pulse_until)
|
||||
pad->wButtons |= XINPUT_GAMEPAD_START;
|
||||
}
|
||||
/* (the Steam Frame's controllers: the left one's View button and D-pad) */
|
||||
if (left->buttons & HALO_XR_BUTTON_VIEW) pad->wButtons |= XINPUT_GAMEPAD_BACK;
|
||||
if (left->buttons & HALO_XR_BUTTON_DPAD_UP) pad->wButtons |= XINPUT_GAMEPAD_DPAD_UP;
|
||||
@@ -1148,7 +1331,8 @@ DWORD WINAPI XInputGetState(HANDLE device, PXINPUT_STATE state)
|
||||
wheel_update();
|
||||
keyboard_actions_held = 0;
|
||||
keys_held_over_switch(&input);
|
||||
console_active = console_is_active();
|
||||
/* (a chat line typed takes the keyboard as the console does) */
|
||||
console_active = console_is_active() || network_chat_typing();
|
||||
held = console_active ? 0 : keyboard_bound_actions(&input);
|
||||
keyboard_screenshot(held);
|
||||
if (!console_active)
|
||||
@@ -1175,6 +1359,10 @@ DWORD WINAPI XInputGetState(HANDLE device, PXINPUT_STATE state)
|
||||
touch_input_controls(&state->Gamepad, input.menus);
|
||||
#endif
|
||||
}
|
||||
/* (the text chat's on-screen keyboard reads them, and takes them
|
||||
while it is up) */
|
||||
chat_pad_record(&state->Gamepad);
|
||||
chat_pad_hold_over(&state->Gamepad);
|
||||
if (abs(state->Gamepad.sThumbRX) > STICK_AIMING_DEFLECTION ||
|
||||
abs(state->Gamepad.sThumbRY) > STICK_AIMING_DEFLECTION)
|
||||
{
|
||||
@@ -1256,7 +1444,7 @@ DWORD WINAPI XInputDebugGetKeystroke(PXINPUT_DEBUG_KEYSTROKE keystroke)
|
||||
/* key ups always pass, so no key is left latched down; while typing,
|
||||
escape does not (it cancels, as B: the game's own escape leaves the
|
||||
menus, main.c) */
|
||||
if (key_up || next.virtual_key == VK_OEM_3_BACKQUOTE || console_is_active() ||
|
||||
if (key_up || next.virtual_key == VK_OEM_3_BACKQUOTE || console_is_active() || network_chat_typing() ||
|
||||
(text_typing && next.virtual_key != 0x1B /* escape */))
|
||||
{
|
||||
keystroke->VirtualKey = next.virtual_key;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org/>
|
||||
@@ -0,0 +1,17 @@
|
||||
# english-words
|
||||
|
||||
A list of 370,105 English words, by dwyl and its contributors, released into
|
||||
the public domain (the Unlicense, see `LICENSE.md`).
|
||||
|
||||
Upstream: https://github.com/dwyl/english-words, commit
|
||||
`20f5cc9b3f0ccc8ce45d814c532b7c2031bba31c`. `words_alpha.txt.gz` is its
|
||||
`words_alpha.txt` (SHA-256
|
||||
3ed0c94610d8bcf7c11bbb49c56aa49c7234d32b66824df91f554169e572da48), unchanged
|
||||
but compressed (`gzip -9 -n`).
|
||||
|
||||
Nothing the game builds uses it. Streamer mode's tools do:
|
||||
`tools/text_filter_terms.py` works out where each word it hides may be found
|
||||
(inside a word, at a word's start, or only as a whole word) from which
|
||||
English words contain it, and `tools/test_text_filter_terms.py` checks that
|
||||
the words hidden in English are those expected
|
||||
(`port/assets/text_filter/english.txt`).
|
||||
@@ -366,6 +366,23 @@ the `pages` job deploys the release build to GitHub Pages: only from `main`,
|
||||
only once every platform built and the release is out, and never cancelled
|
||||
halfway. The Discord post has a Web field and the site's address.
|
||||
|
||||
The game's wasm, most of a build, does not come from GitHub Pages, which
|
||||
serves 100 GB a month: the `pages` job pushes it alone in a commit of the
|
||||
`web-wasm` branch (over the last one, so the repository keeps one copy),
|
||||
checks that jsDelivr serves that commit's file
|
||||
(`https://cdn.jsdelivr.net/gh/OpenCommunityEdition/OpenCE@<commit>/halo.wasm`,
|
||||
with CORS, which GitHub's release downloads lack), and names it and its
|
||||
SHA-256 in `version.json` (`"wasm": {"url", "sha256"}`). The service worker
|
||||
fetches the wasm from there as it caches the build, checks its SHA-256, and
|
||||
takes the site's copy only when that fails; the page loads `halo.wasm` from
|
||||
the site as before, from the worker's cache. jsDelivr serves files of at most
|
||||
20 MB from GitHub: a larger wasm comes from the site, and the step says so.
|
||||
|
||||
The page counts its visits with Umami (`https://nexus.mrbruh.com/app-state`
|
||||
in `index.html`, which sets no cookies). The page being cross-origin
|
||||
isolated, the script is loaded with `crossorigin="anonymous"`: its host sends
|
||||
CORS headers, not `Cross-Origin-Resource-Policy`.
|
||||
|
||||
Once, an owner of the organization sets it up:
|
||||
|
||||
1. Organization settings → Pages → **Add a verified domain**:
|
||||
@@ -387,7 +404,8 @@ response header rule adding `Cross-Origin-Opener-Policy: same-origin`,
|
||||
`Cross-Origin-Embedder-Policy: require-corp` and
|
||||
`Cross-Origin-Resource-Policy: same-origin`: the first visit then needs no
|
||||
reload, and Cloudflare's cache takes GitHub Pages' bandwidth (100 GB a month;
|
||||
a first visit downloads about 10 MB, compressed).
|
||||
a first visit downloads about 10 MB, compressed, most of it the wasm from
|
||||
jsDelivr).
|
||||
|
||||
## Files
|
||||
|
||||
|
||||
@@ -351,6 +351,7 @@ async function refreshMods() {
|
||||
}));
|
||||
$('mods-status').textContent = found.length ? `${found.length} mod${found.length === 1 ? '' : 's'} in this browser.` :
|
||||
'No mods yet.';
|
||||
summarize('summary-mods', null, found.length ? `${found.length} mod${found.length === 1 ? '' : 's'}` : 'None yet');
|
||||
await refreshStorage();
|
||||
}
|
||||
|
||||
@@ -513,10 +514,19 @@ function canPlay() {
|
||||
return checksPassed && dataReady && !gameStarted;
|
||||
}
|
||||
|
||||
// the Ready to play screen's rows: a row good or bad, and its value
|
||||
function summarize(id, good, text) {
|
||||
$(id).classList.toggle('good', good === true);
|
||||
$(id).classList.toggle('bad', good === false);
|
||||
$(id + '-value').textContent = text;
|
||||
}
|
||||
|
||||
function updatePlay() {
|
||||
$('play').disabled = !canPlay();
|
||||
$('play-note').textContent = !checksPassed ? 'This browser cannot run the game (above).' :
|
||||
$('play-note').textContent = !checksPassed ? 'This browser cannot run the game: see This browser, below.' :
|
||||
!dataReady ? 'The game data is needed first.' : '';
|
||||
summarize('summary-browser', checksPassed, checksPassed ? 'Runs the game' : 'Cannot run the game');
|
||||
summarize('summary-data', dataReady, dataReady ? $('data-status').textContent : 'Needed first');
|
||||
}
|
||||
|
||||
// init.txt in the data folder: the console commands the game runs as it
|
||||
|
||||
@@ -5,109 +5,158 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<title>OpenCE</title>
|
||||
<meta name="description" content="Halo: Combat Evolved in your browser, from your own Xbox disc image. OpenCE, the decompilation's port.">
|
||||
<meta name="theme-color" content="#0a0e14">
|
||||
<meta name="theme-color" content="#072852">
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
<link rel="icon" href="icons/icon-32.png" sizes="32x32">
|
||||
<link rel="apple-touch-icon" href="icons/icon-180.png">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<!-- visits counted with Umami (no cookies); crossorigin: the page is cross-origin isolated (sw.js), and the
|
||||
script's host sends CORS headers but no Cross-Origin-Resource-Policy -->
|
||||
<script async src="https://nexus.mrbruh.com/app-state" data-website-id="41f29092-7d68-41d8-b562-c1e3d851a778"
|
||||
crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main id="launcher">
|
||||
<header class="masthead">
|
||||
<img src="icons/icon-192.png" alt="" width="72" height="72">
|
||||
<div>
|
||||
<h1>OpenCE</h1>
|
||||
<p class="tagline">Halo: Combat Evolved in your browser, from your own Xbox disc.</p>
|
||||
<div class="masthead-inner">
|
||||
<img src="icons/icon-192.png" alt="" width="68" height="68">
|
||||
<div>
|
||||
<h1>OpenCE</h1>
|
||||
<p class="tagline">Halo: Combat Evolved in your browser, from your own Xbox disc.</p>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="panel" id="checks-panel" aria-labelledby="checks-title">
|
||||
<h2 id="checks-title">This browser</h2>
|
||||
<ul id="checks" class="checks"></ul>
|
||||
<p id="checks-note" class="note" hidden></p>
|
||||
</section>
|
||||
<div class="stage">
|
||||
<div class="layout">
|
||||
<nav class="menu" aria-label="Launcher">
|
||||
<a href="#play-panel" class="menu-current">Play</a>
|
||||
<a href="#data-panel">Game data</a>
|
||||
<a href="#mods-panel">Mods</a>
|
||||
<a href="#room-panel">Play together</a>
|
||||
<a href="#checks-panel">This browser</a>
|
||||
<a href="#settings-panel">Settings and data</a>
|
||||
<a href="#about-panel">About</a>
|
||||
<p class="menu-note">Keyboard: as on the desktop, but crouch is C (Ctrl would close the tab).</p>
|
||||
<p class="menu-note"><a href="https://discord.com/invite/OpenCE" rel="noopener">Join us on Discord</a></p>
|
||||
</nav>
|
||||
|
||||
<section class="panel" id="data-panel" aria-labelledby="data-title">
|
||||
<h2 id="data-title">Game data</h2>
|
||||
<p id="data-status" class="status">Looking…</p>
|
||||
<div class="actions">
|
||||
<label class="button" id="image-label">Choose a disc image…
|
||||
<input type="file" id="image-input" accept=".iso,.xiso,application/octet-stream" hidden>
|
||||
</label>
|
||||
<label class="button" id="folder-label">Choose a maps folder…
|
||||
<input type="file" id="folder-input" webkitdirectory multiple hidden>
|
||||
</label>
|
||||
</div>
|
||||
<div id="import-progress" class="progress" hidden>
|
||||
<div class="progress-bar"><div id="import-bar"></div></div>
|
||||
<p id="import-text" class="note"></p>
|
||||
</div>
|
||||
<p class="note">The maps are copied out of your own disc image (an .iso of Halo: Combat Evolved for the
|
||||
Xbox) into this browser's storage for this site. Nothing is uploaded, and the site serves no game data.</p>
|
||||
</section>
|
||||
<div class="screens">
|
||||
<section class="screen" id="play-panel" aria-labelledby="play-title">
|
||||
<h2 id="play-title">Ready to play</h2>
|
||||
<div class="rows">
|
||||
<div class="row" id="summary-browser"><span class="row-label">This browser</span>
|
||||
<span class="row-value" id="summary-browser-value">Looking…</span></div>
|
||||
<div class="row" id="summary-data"><span class="row-label">Game data</span>
|
||||
<span class="row-value" id="summary-data-value">Looking…</span></div>
|
||||
<div class="row" id="summary-mods"><span class="row-label">Mods</span>
|
||||
<span class="row-value" id="summary-mods-value">None yet</span></div>
|
||||
</div>
|
||||
<p class="help">The game starts in this tab. Its own menus, saved games and settings stay in this browser.</p>
|
||||
<p id="play-note" class="help note"></p>
|
||||
<div class="button-bar">
|
||||
<button id="play" class="primary play" disabled>Play</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="mods-panel" aria-labelledby="mods-title">
|
||||
<h2 id="mods-title">Mods</h2>
|
||||
<p id="mods-status" class="status">No mods yet.</p>
|
||||
<ul id="mods-list" class="mods"></ul>
|
||||
<div class="actions">
|
||||
<label class="button" id="mod-label">Add a mod folder…
|
||||
<input type="file" id="mod-input" webkitdirectory multiple hidden>
|
||||
</label>
|
||||
</div>
|
||||
<p class="note">A mod is a folder with a mod.toml and a tags folder of Halo PC tag files: sounds, textures and
|
||||
text that play over the maps' for you alone. Each is played once added: the game's main menu's Mods turns them
|
||||
off and sets the order they load in.</p>
|
||||
</section>
|
||||
<section class="screen" id="data-panel" aria-labelledby="data-title">
|
||||
<h2 id="data-title">Game data</h2>
|
||||
<div class="rows">
|
||||
<div class="row selected"><span class="row-label">Maps</span>
|
||||
<span class="row-value" id="data-status">Looking…</span></div>
|
||||
<div id="import-progress" class="row progress" hidden>
|
||||
<div class="progress-bar"><div id="import-bar"></div></div>
|
||||
<p id="import-text" class="note"></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">The maps are copied out of your own disc image (an .iso of Halo: Combat Evolved for the
|
||||
Xbox) into this browser's storage for this site. Nothing is uploaded, and the site serves no game data.</p>
|
||||
<div class="button-bar">
|
||||
<label class="button" id="image-label">Choose a disc image…
|
||||
<input type="file" id="image-input" accept=".iso,.xiso,application/octet-stream" hidden>
|
||||
</label>
|
||||
<label class="button" id="folder-label">Choose a maps folder…
|
||||
<input type="file" id="folder-input" webkitdirectory multiple hidden>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="room-panel" aria-labelledby="room-title">
|
||||
<h2 id="room-title">Play together</h2>
|
||||
<p id="room-status" class="status">Play system link with friends in their browsers: create a room and send them
|
||||
its link. Each of you then finds the others' games under Multiplayer.</p>
|
||||
<div class="actions">
|
||||
<button id="room-create">Create a room</button>
|
||||
<button id="room-copy" hidden>Copy the room's link</button>
|
||||
<button id="room-leave" hidden>Leave the room</button>
|
||||
</div>
|
||||
<p class="note">The browsers of a room connect to each other directly. They find each other through public
|
||||
message brokers, which see nothing of the room: what they pass on is sealed with the link's secret. The
|
||||
Linux, Windows and Android builds cannot join a room yet.</p>
|
||||
</section>
|
||||
<section class="screen" id="mods-panel" aria-labelledby="mods-title">
|
||||
<h2 id="mods-title">Mods</h2>
|
||||
<div class="rows">
|
||||
<p id="mods-status" class="row status">No mods yet.</p>
|
||||
<ul id="mods-list" class="mods"></ul>
|
||||
</div>
|
||||
<p class="help">A mod is a folder with a mod.toml and a tags folder of Halo PC tag files: sounds, textures
|
||||
and text that play over the maps' for you alone. Each is played once added: the game's main menu's Mods
|
||||
turns them off and sets the order they load in.</p>
|
||||
<div class="button-bar">
|
||||
<label class="button" id="mod-label">Add a mod folder…
|
||||
<input type="file" id="mod-input" webkitdirectory multiple hidden>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="play-row">
|
||||
<button id="play" class="primary" disabled>Play</button>
|
||||
<p id="play-note" class="note"></p>
|
||||
<section class="screen" id="room-panel" aria-labelledby="room-title">
|
||||
<h2 id="room-title">Play together</h2>
|
||||
<p id="room-status" class="help">Play system link with friends in their browsers: create a room and send
|
||||
them its link. Each of you then finds the others' games under Multiplayer.</p>
|
||||
<p class="help note">The browsers of a room connect to each other directly. They find each other through
|
||||
public message brokers, which see nothing of the room: what they pass on is sealed with the link's
|
||||
secret. The Linux, Windows and Android builds cannot join a room yet.</p>
|
||||
<div class="button-bar">
|
||||
<button id="room-create">Create a room</button>
|
||||
<button id="room-copy" hidden>Copy the room's link</button>
|
||||
<button id="room-leave" hidden>Leave the room</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="screen no-bar" id="checks-panel" aria-labelledby="checks-title">
|
||||
<h2 id="checks-title">This browser</h2>
|
||||
<div class="rows">
|
||||
<ul id="checks" class="checks"></ul>
|
||||
</div>
|
||||
<p id="checks-note" class="help note" hidden></p>
|
||||
</section>
|
||||
|
||||
<section class="screen" id="settings-panel" aria-labelledby="settings-title">
|
||||
<h2 id="settings-title">Settings and data</h2>
|
||||
<div class="rows">
|
||||
<div class="row"><span class="row-label">This site</span>
|
||||
<span class="row-value" id="storage-status"></span></div>
|
||||
</div>
|
||||
<p class="help">The game's own settings (Settings in its menus, and <code>config.toml</code>) travel with
|
||||
exported saved games.</p>
|
||||
<div class="button-bar">
|
||||
<button id="persist">Keep this site's data</button>
|
||||
<button id="export-saves">Export saved games</button>
|
||||
<button id="download-log">Download the log</button>
|
||||
<button id="delete-data" class="danger">Delete the game data</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="screen" id="about-panel" aria-labelledby="about-title">
|
||||
<h2 id="about-title">About</h2>
|
||||
<p class="help">OpenCE is the Halo: Combat Evolved decompilation (Xbox build 01.01.14.2342), ported to
|
||||
Linux, Windows, Android and the web. It is not affiliated with Microsoft or Bungie.</p>
|
||||
<dl class="rows facts">
|
||||
<div class="row"><dt class="row-label">Build</dt><dd class="row-value" id="about-build">–</dd></div>
|
||||
<div class="row"><dt class="row-label">Commit</dt><dd class="row-value" id="about-commit">–</dd></div>
|
||||
<div class="row"><dt class="row-label">Network version</dt>
|
||||
<dd class="row-value" id="about-network">–</dd></div>
|
||||
</dl>
|
||||
<div class="button-bar links">
|
||||
<a href="https://discord.com/invite/OpenCE" rel="noopener">Discord</a>
|
||||
<a href="https://github.com/OpenCommunityEdition/OpenCE">Source</a>
|
||||
<a href="https://github.com/OpenCommunityEdition/OpenCE/releases/latest">Linux, Windows and Android
|
||||
builds</a>
|
||||
<a href="licenses.txt">Licences</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<details class="panel" id="settings-panel">
|
||||
<summary>Settings and data</summary>
|
||||
<p id="storage-status" class="note"></p>
|
||||
<div class="actions">
|
||||
<button id="persist">Keep this site's data</button>
|
||||
<button id="export-saves">Export saved games</button>
|
||||
<button id="download-log">Download the log</button>
|
||||
<button id="delete-data" class="danger">Delete the game data</button>
|
||||
</div>
|
||||
<p class="note">The game's own settings (Settings in its menus, and <code>config.toml</code>) travel with
|
||||
exported saved games. Keyboard: as on the desktop, but crouch is C (Ctrl would close the tab).</p>
|
||||
</details>
|
||||
|
||||
<details class="panel" id="about-panel">
|
||||
<summary>About</summary>
|
||||
<p>OpenCE is the Halo: Combat Evolved decompilation (Xbox build 01.01.14.2342), ported to Linux, Windows,
|
||||
Android and the web. It is not affiliated with Microsoft or Bungie.</p>
|
||||
<dl class="facts">
|
||||
<dt>Build</dt><dd id="about-build">–</dd>
|
||||
<dt>Commit</dt><dd id="about-commit">–</dd>
|
||||
<dt>Network version</dt><dd id="about-network">–</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<a href="https://github.com/OpenCommunityEdition/OpenCE">Source</a> ·
|
||||
<a href="https://github.com/OpenCommunityEdition/OpenCE/releases/latest">Linux, Windows and Android builds</a> ·
|
||||
<a href="licenses.txt">Licences</a>
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<footer class="site-footer">
|
||||
<p>OpenCE is an unofficial fan project. It is not endorsed by or affiliated with Microsoft, Xbox Game Studios,
|
||||
Halo Studios or Bungie. Halo and Halo: Combat Evolved are trademarks of Microsoft Corporation;
|
||||
@@ -129,6 +178,8 @@
|
||||
<button id="invite-close" aria-label="Hide">Hide</button>
|
||||
</div>
|
||||
<div class="toolbar" id="toolbar">
|
||||
<a class="button" id="discord" href="https://discord.com/invite/OpenCE" target="_blank" rel="noopener"
|
||||
title="Our Discord, in a new tab (the game goes on)">Join Discord</a>
|
||||
<button id="fullscreen" title="Fullscreen">Fullscreen</button>
|
||||
<button id="leave" title="Back to the launcher (the game stops)">Quit</button>
|
||||
</div>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"scope": "./",
|
||||
"display": "fullscreen",
|
||||
"orientation": "landscape",
|
||||
"background_color": "#0a0e14",
|
||||
"theme_color": "#0a0e14",
|
||||
"background_color": "#02060c",
|
||||
"theme_color": "#072852",
|
||||
"icons": [
|
||||
{ "src": "icons/icon-192.png", "sizes": "192x192", "type": "image/png" },
|
||||
{ "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" }
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/* The launcher page (index.html): the colours of the game's menus, the
|
||||
fonts the port draws them with (Overpass, and OpenCE for the title). */
|
||||
/* The launcher page (index.html), in the look of the menus' redraws
|
||||
(port/assets/menus/svg): navy panels with a 2px blue edge, the selected
|
||||
one brighter and glowing, the settings screens' gradient between a bright
|
||||
rule and a button bar's, and the fonts the port draws the menus with
|
||||
(OpenCE for titles, Overpass for the rest). */
|
||||
|
||||
@font-face {
|
||||
font-family: "OpenCE";
|
||||
@@ -12,29 +15,42 @@
|
||||
src: url("fonts/Overpass-750.ttf") format("truetype");
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Overpass";
|
||||
font-weight: 900;
|
||||
src: url("fonts/Overpass-900.ttf") format("truetype");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--background: #0a0e14;
|
||||
--panel: #111925;
|
||||
--panel-edge: #23324a;
|
||||
--text: #dbe4f0;
|
||||
--muted: #8ea0b8;
|
||||
--accent: #4fb3ff;
|
||||
--accent-text: #04121f;
|
||||
--good: #5ed39a;
|
||||
--bad: #ff6b6b;
|
||||
--warn: #f2c14e;
|
||||
--radius: 10px;
|
||||
/* the redraws' colours */
|
||||
--ground: #02060c;
|
||||
--navy: #002244;
|
||||
--navy-deep: #000e23;
|
||||
--row: rgba(0, 17, 34, 0.6);
|
||||
--edge: #2299ff;
|
||||
--edge-bright: #36afff;
|
||||
--edge-dim: #1d4f86;
|
||||
--label: #2896ff;
|
||||
--text: #ffffff;
|
||||
--soft: #c9daf0;
|
||||
--glow: rgba(54, 175, 255, 0.45);
|
||||
/* a problem: orange, apart from the blue in lightness too */
|
||||
--bad: #ff9b42;
|
||||
--bad-text: #ffd2a8;
|
||||
--bad-ground: #2a1404;
|
||||
--label-font: "Overpass", system-ui, sans-serif;
|
||||
--title-font: "OpenCE", "Overpass", system-ui, sans-serif;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
background: var(--background);
|
||||
background: var(--ground);
|
||||
color: var(--text);
|
||||
font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
font: 750 16px/1.5 var(--label-font);
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -42,110 +58,275 @@ body {
|
||||
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
|
||||
}
|
||||
|
||||
a { color: var(--accent); }
|
||||
code { font-size: 0.9em; }
|
||||
a { color: var(--edge-bright); }
|
||||
a:hover { color: #9fd6ff; }
|
||||
code { font-size: 0.95em; }
|
||||
|
||||
#launcher {
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
padding: 32px 16px 64px;
|
||||
}
|
||||
/* ---------- the masthead: the settings screens' header band */
|
||||
|
||||
.masthead {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
background: linear-gradient(180deg, #0b3466 0%, #072852 45%, #041a35 100%);
|
||||
border-bottom: 1px solid var(--edge-bright);
|
||||
}
|
||||
.masthead img { border-radius: 16px; flex: none; }
|
||||
.masthead-inner {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
padding: 28px 32px 24px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
.masthead img { flex: none; border-radius: 14px; box-shadow: 0 0 0 2px var(--edge); }
|
||||
.masthead h1 {
|
||||
margin: 0;
|
||||
font: 400 44px/1 "OpenCE", "Overpass", system-ui, sans-serif;
|
||||
font: 400 60px/1 var(--title-font);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
.tagline { margin: 6px 0 0; color: var(--muted); }
|
||||
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--panel-edge);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px 20px;
|
||||
margin: 16px 0;
|
||||
}
|
||||
.panel h2, .panel summary, .sheet h2 {
|
||||
margin: 0 0 8px;
|
||||
font: 750 15px/1.3 "Overpass", system-ui, sans-serif;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--muted);
|
||||
color: var(--label);
|
||||
text-shadow: 0 0 22px var(--glow);
|
||||
}
|
||||
details.panel summary { cursor: pointer; margin: 0; }
|
||||
details.panel[open] summary { margin-bottom: 12px; }
|
||||
.tagline { margin: 4px 0 0; color: var(--soft); }
|
||||
|
||||
.checks { list-style: none; margin: 0; padding: 0; }
|
||||
.checks li { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
|
||||
.checks li::before {
|
||||
content: "";
|
||||
flex: none;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--muted);
|
||||
transform: translateY(-1px);
|
||||
/* ---------- the stage: the menu beside the screens */
|
||||
|
||||
.stage { background: linear-gradient(180deg, #072852 0px, #062247 320px, #031122 960px, var(--ground) 1500px); }
|
||||
.layout {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
padding: 40px 32px 64px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
gap: 40px;
|
||||
}
|
||||
.checks li.good::before { background: var(--good); }
|
||||
.checks li.bad::before { background: var(--bad); }
|
||||
.checks li.warn::before { background: var(--warn); }
|
||||
.checks .detail { color: var(--muted); font-size: 14px; }
|
||||
|
||||
.status { margin: 0 0 12px; }
|
||||
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
|
||||
/* the main menu's list: each item its words, the current one the redraws'
|
||||
selected list item (a rounded left end, open on the right) */
|
||||
.menu {
|
||||
flex: 1 1 260px;
|
||||
max-width: 340px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
.menu > a {
|
||||
display: block;
|
||||
padding: 12px 22px;
|
||||
border: 2px solid transparent;
|
||||
border-right: none;
|
||||
border-radius: 18px 0 0 18px;
|
||||
color: var(--label);
|
||||
text-decoration: none;
|
||||
font: 900 22px/1.3 var(--label-font);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.menu > a:hover, .menu > a:focus-visible, .menu > a.menu-current {
|
||||
border-color: var(--edge);
|
||||
background: var(--navy-deep);
|
||||
color: var(--text);
|
||||
text-shadow: 0 0 12px rgba(54, 175, 255, 0.8);
|
||||
outline: none;
|
||||
}
|
||||
.menu-note { margin: 18px 22px 0; font-size: 14px; line-height: 1.55; color: var(--soft); }
|
||||
|
||||
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.screens {
|
||||
flex: 999 1 560px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 36px;
|
||||
}
|
||||
|
||||
/* a screen: a title, its rows, its help and its button bar, between the
|
||||
settings screens' bright rule and the button bar's */
|
||||
.screen {
|
||||
background: rgba(0, 10, 24, 0.55);
|
||||
border-top: 1px solid var(--edge-bright);
|
||||
border-bottom: 1px solid var(--label);
|
||||
scroll-margin-top: 16px;
|
||||
}
|
||||
.screen h2 {
|
||||
margin: 0;
|
||||
padding: 22px 28px 14px;
|
||||
font: 400 36px/1.1 var(--title-font);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--label);
|
||||
}
|
||||
.rows {
|
||||
margin: 0;
|
||||
padding: 0 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.help { margin: 0; padding: 16px 28px 0; }
|
||||
.screen h2 + .help { padding-top: 0; }
|
||||
.help.note { color: var(--soft); font-size: 14px; }
|
||||
.help:empty, .note:empty { display: none; }
|
||||
/* (a screen without a button bar ends its rows as the bar would) */
|
||||
.screen.no-bar { padding-bottom: 24px; }
|
||||
.button-bar {
|
||||
margin-top: 20px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border-top: 1px solid var(--label);
|
||||
padding: 16px 28px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.button-bar.links { gap: 8px 24px; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase; }
|
||||
|
||||
/* a row: the unselected option's translucent bar, a selected one the
|
||||
redraws' panel with the blue edge; its label in blue, its value white */
|
||||
.row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 6px 16px;
|
||||
min-height: 44px;
|
||||
margin: 0;
|
||||
padding: 8px 18px;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 12px;
|
||||
background: var(--row);
|
||||
}
|
||||
.row.selected { border-color: var(--edge); background: var(--navy); }
|
||||
.row-label { margin: 0; color: var(--label); text-transform: uppercase; letter-spacing: 0.03em; }
|
||||
.row-value { margin: 0; text-align: right; overflow-wrap: anywhere; text-transform: uppercase; }
|
||||
/* (a tick: the bright blue's) */
|
||||
.row.good .row-value, .checks li.good::after {
|
||||
padding-left: 24px;
|
||||
background: left center / 16px 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2336afff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
|
||||
}
|
||||
.row.bad, .checks li.bad { border-color: var(--bad); background: var(--bad-ground); }
|
||||
.row.bad .row-label, .checks li.bad { color: #ffb46e; }
|
||||
.row.bad .row-value { color: var(--bad-text); }
|
||||
.status { color: var(--soft); text-transform: uppercase; letter-spacing: 0.03em; }
|
||||
|
||||
/* the browser's checks (app.js's addCheck: a class good, bad or warn, its
|
||||
words, and a detail): rows, the label's words in blue and a mark at the end */
|
||||
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
||||
.checks li {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 16px;
|
||||
min-height: 44px;
|
||||
padding: 8px 18px;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 12px;
|
||||
background: var(--row);
|
||||
color: var(--label);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
.checks li::after { order: 2; margin-left: auto; color: var(--text); }
|
||||
.checks li.good::after { content: "Yes"; }
|
||||
.checks li.bad::after { content: "Missing"; color: var(--bad-text); }
|
||||
.checks li.warn { border-color: var(--edge-dim); }
|
||||
.checks li.warn::after { content: "Maybe"; color: var(--soft); }
|
||||
.checks .detail {
|
||||
order: 3;
|
||||
flex-basis: 100%;
|
||||
color: var(--soft);
|
||||
font-size: 14px;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
/* the mods (app.js: a name with its folder, and Remove): rows */
|
||||
.mods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
||||
.mods:empty { display: none; }
|
||||
.mods li {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px 16px;
|
||||
min-height: 44px;
|
||||
padding: 6px 8px 6px 18px;
|
||||
border-radius: 12px;
|
||||
background: var(--row);
|
||||
color: var(--label);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
.mods .detail { color: var(--soft); font-size: 14px; text-transform: none; letter-spacing: 0; }
|
||||
.mods button { min-height: 36px; padding: 0 16px; font-size: 13px; }
|
||||
|
||||
/* the copy of the maps: a meter in a row */
|
||||
.progress { flex-direction: column; align-items: stretch; }
|
||||
.progress-bar { height: 10px; border-radius: 5px; background: var(--navy-deep); box-shadow: inset 0 0 0 1px var(--edge-dim); overflow: hidden; }
|
||||
.progress-bar > div {
|
||||
height: 100%;
|
||||
width: 0;
|
||||
border-radius: 5px;
|
||||
background: var(--edge);
|
||||
box-shadow: 0 0 10px rgba(54, 175, 255, 0.6);
|
||||
transition: width 0.2s;
|
||||
}
|
||||
.progress .note { margin: 0; color: var(--soft); font-size: 14px; }
|
||||
|
||||
.facts dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; text-transform: none; }
|
||||
|
||||
/* ---------- buttons: the redraws' text button, the default one glowing */
|
||||
|
||||
button, .button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 40px;
|
||||
padding: 8px 16px;
|
||||
border: 1px solid var(--panel-edge);
|
||||
border-radius: 8px;
|
||||
background: #182436;
|
||||
min-height: 44px;
|
||||
padding: 0 22px;
|
||||
border: 2px solid var(--edge);
|
||||
border-radius: 10px;
|
||||
background: var(--navy);
|
||||
color: var(--text);
|
||||
font: 750 14px/1 "Overpass", system-ui, sans-serif;
|
||||
letter-spacing: 0.04em;
|
||||
font: 750 15px/1 var(--label-font);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
|
||||
button:focus-visible, .button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
button:disabled, .button.disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
button.primary {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: var(--accent-text);
|
||||
button:hover:not(:disabled), .button:hover { border-color: var(--edge-bright); box-shadow: 0 0 12px var(--glow); }
|
||||
button:focus-visible, .button:focus-within { outline: 2px solid var(--edge-bright); outline-offset: 3px; }
|
||||
button:disabled, .button.disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
|
||||
button.primary { border-color: var(--edge-bright); font-weight: 900; box-shadow: 0 0 14px var(--glow); }
|
||||
button.play { min-height: 52px; min-width: 220px; padding: 0 36px; font-size: 22px; letter-spacing: 0.08em; }
|
||||
button.danger { border-color: var(--bad); background: var(--bad-ground); color: var(--bad-text); }
|
||||
button.danger:hover:not(:disabled) { border-color: #ffb46e; box-shadow: 0 0 12px rgba(255, 155, 66, 0.4); }
|
||||
|
||||
.note { color: var(--soft); font-size: 14px; }
|
||||
|
||||
.site-footer { background: #000000; border-top: 1px solid var(--label); }
|
||||
.site-footer p {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
padding: 24px 32px 32px;
|
||||
color: #a9bfdc;
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }
|
||||
|
||||
.mods { list-style: none; margin: 0 0 12px; padding: 0; }
|
||||
.mods li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 4px 0; }
|
||||
.mods .detail { color: var(--muted); font-size: 14px; }
|
||||
@media (max-width: 640px) {
|
||||
.masthead-inner { padding: 20px 16px; gap: 14px; }
|
||||
.masthead img { width: 52px; height: 52px; }
|
||||
.masthead h1 { font-size: 44px; }
|
||||
.layout { padding: 24px 16px 48px; gap: 24px; }
|
||||
.menu { max-width: none; }
|
||||
.menu > a { font-size: 19px; padding: 10px 18px; }
|
||||
.screen h2 { padding: 18px 16px 12px; font-size: 30px; }
|
||||
.rows { padding: 0 16px; }
|
||||
.help { padding: 14px 16px 0; }
|
||||
.button-bar { padding: 14px 16px; }
|
||||
.site-footer p { padding: 20px 16px 28px; }
|
||||
}
|
||||
|
||||
.play-row { margin: 24px 0; }
|
||||
.play-row .primary { min-width: 200px; min-height: 52px; font-size: 18px; }
|
||||
/* ---------- the game: the canvas fills the window */
|
||||
|
||||
.progress { margin-top: 12px; }
|
||||
.progress-bar { height: 8px; border-radius: 4px; background: #1d2a3e; overflow: hidden; }
|
||||
.progress-bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
|
||||
|
||||
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; }
|
||||
.facts dt { color: var(--muted); }
|
||||
.facts dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: 14px; }
|
||||
|
||||
.site-footer { margin: 32px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
|
||||
.site-footer p { margin: 0; }
|
||||
|
||||
/* the game: the canvas fills the window */
|
||||
#game { position: fixed; inset: 0; background: #000; }
|
||||
#canvas {
|
||||
display: block;
|
||||
@@ -162,15 +343,18 @@ button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad)
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
color: var(--muted);
|
||||
color: var(--label);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
pointer-events: none;
|
||||
}
|
||||
.spinner {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 3px solid #1d2a3e;
|
||||
border-top-color: var(--accent);
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 3px solid var(--edge-dim);
|
||||
border-top-color: var(--edge-bright);
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 14px var(--glow);
|
||||
animation: spin 0.9s linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
@@ -179,40 +363,50 @@ button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad)
|
||||
top: max(8px, env(safe-area-inset-top));
|
||||
right: max(8px, env(safe-area-inset-right));
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
opacity: 0.25;
|
||||
gap: 8px;
|
||||
opacity: 0.3;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.toolbar:hover, .toolbar:focus-within { opacity: 1; }
|
||||
.toolbar button { min-height: 32px; padding: 6px 10px; font-size: 12px; background: rgba(10, 14, 20, 0.8); }
|
||||
/* a game hosted for the internet: its invite link (app.js) */
|
||||
.toolbar button, .toolbar .button { min-height: 36px; padding: 0 14px; font-size: 13px; background: rgba(0, 34, 68, 0.85); }
|
||||
.toolbar .button { text-decoration: none; }
|
||||
|
||||
/* a game hosted for the internet: its invite link (app.js), in a pause box */
|
||||
.invite {
|
||||
position: absolute;
|
||||
top: max(8px, env(safe-area-inset-top));
|
||||
left: max(8px, env(safe-area-inset-left));
|
||||
max-width: calc(100% - 200px);
|
||||
max-width: calc(100% - 220px);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
background: rgba(10, 14, 20, 0.85);
|
||||
color: var(--text);
|
||||
font-size: 12px;
|
||||
gap: 8px 10px;
|
||||
padding: 12px 14px;
|
||||
border: 2px solid var(--edge);
|
||||
border-radius: 14px;
|
||||
background: rgba(0, 14, 35, 0.92);
|
||||
box-shadow: 0 0 24px rgba(54, 175, 255, 0.25);
|
||||
color: var(--label);
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.invite span { flex: 1 1 100%; }
|
||||
.invite input {
|
||||
flex: 1 1 260px;
|
||||
flex: 1 1 280px;
|
||||
min-width: 0;
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--panel-edge);
|
||||
border-radius: 6px;
|
||||
background: #0a0e14;
|
||||
min-height: 40px;
|
||||
padding: 0 12px;
|
||||
border: 2px solid var(--edge-dim);
|
||||
border-radius: 10px;
|
||||
background: var(--navy-deep);
|
||||
color: var(--text);
|
||||
font: 12px ui-monospace, monospace;
|
||||
font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
.invite button { min-height: 30px; padding: 6px 10px; font-size: 12px; }
|
||||
.invite button { min-height: 40px; padding: 0 16px; font-size: 13px; }
|
||||
.invite #invite-copy { border-color: var(--edge-bright); box-shadow: 0 0 12px var(--glow); }
|
||||
|
||||
/* a question, or the game stopped: a pause box over the page */
|
||||
.sheet {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
@@ -220,46 +414,76 @@ button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad)
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
background: rgba(0, 0, 0, 0.75);
|
||||
background: rgba(0, 4, 10, 0.78);
|
||||
z-index: 10;
|
||||
}
|
||||
#ask-text { white-space: pre-line; }
|
||||
|
||||
.sheet-body {
|
||||
width: min(760px, 100%);
|
||||
width: min(720px, 100%);
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--panel-edge);
|
||||
border-radius: var(--radius);
|
||||
padding: 20px;
|
||||
border: 2px solid var(--edge);
|
||||
border-radius: 16px;
|
||||
background: var(--navy-deep);
|
||||
box-shadow: 0 0 32px rgba(54, 175, 255, 0.25);
|
||||
}
|
||||
.sheet h2 {
|
||||
margin: 0;
|
||||
padding: 24px 28px 18px;
|
||||
border-bottom: 1px solid var(--edge-bright);
|
||||
background: linear-gradient(180deg, #0b3466 0%, #072852 100%);
|
||||
font: 400 36px/1.05 var(--title-font);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--label);
|
||||
}
|
||||
.sheet-body > p { margin: 0; padding: 20px 28px 0; }
|
||||
.sheet pre {
|
||||
max-height: 40vh;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
background: #070a0f;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
margin: 16px 28px 0;
|
||||
padding: 14px 16px;
|
||||
border: 2px solid var(--edge-dim);
|
||||
border-radius: 10px;
|
||||
background: #00070f;
|
||||
color: var(--soft);
|
||||
font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.sheet .actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
margin-top: 20px;
|
||||
padding: 16px 28px;
|
||||
border-top: 1px solid var(--label);
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
/* a new build: a bar at the top */
|
||||
.banner {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: max(16px, env(safe-area-inset-bottom));
|
||||
top: max(16px, env(safe-area-inset-top));
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
gap: 16px;
|
||||
max-width: calc(100% - 32px);
|
||||
padding: 10px 12px 10px 16px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--accent);
|
||||
border-radius: var(--radius);
|
||||
padding: 8px 8px 8px 22px;
|
||||
border: 2px solid var(--edge);
|
||||
border-radius: 14px;
|
||||
background: rgba(0, 14, 35, 0.95);
|
||||
box-shadow: 0 0 24px rgba(54, 175, 255, 0.25);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
font-size: 15px;
|
||||
z-index: 5;
|
||||
}
|
||||
.banner button { border-color: var(--edge-bright); box-shadow: 0 0 12px var(--glow); }
|
||||
|
||||
/* the on-screen touch controls (touch.js): circles over the game */
|
||||
.touch { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
|
||||
@@ -269,19 +493,19 @@ button.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad)
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
border: 2px solid rgba(219, 228, 240, 0.45);
|
||||
background: rgba(10, 14, 20, 0.28);
|
||||
color: rgba(219, 228, 240, 0.85);
|
||||
font-family: "Overpass", system-ui, sans-serif;
|
||||
border: 2px solid rgba(54, 175, 255, 0.55);
|
||||
background: rgba(0, 14, 35, 0.32);
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
font-family: var(--label-font);
|
||||
font-weight: 750;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.touch-control.held { background: rgba(79, 179, 255, 0.45); border-color: var(--accent); }
|
||||
.touch-stick-zone { background: rgba(10, 14, 20, 0.12); border-style: dashed; }
|
||||
.touch-control.held { background: rgba(34, 153, 255, 0.45); border-color: var(--edge-bright); }
|
||||
.touch-stick-zone { background: rgba(0, 14, 35, 0.14); border-style: dashed; }
|
||||
.touch-stick-ring, .touch-stick-knob { position: absolute; display: none; border-radius: 50%; pointer-events: none; }
|
||||
.touch-stick-ring { border: 2px solid rgba(219, 228, 240, 0.4); }
|
||||
.touch-stick-knob { background: rgba(219, 228, 240, 0.55); }
|
||||
.touch-stick-ring { border: 2px solid rgba(54, 175, 255, 0.45); }
|
||||
.touch-stick-knob { background: rgba(54, 175, 255, 0.55); }
|
||||
|
||||
[hidden] { display: none !important; }
|
||||
@@ -13,7 +13,13 @@ The site's service worker:
|
||||
its files; they are fetched together into a cache of their own, and a new
|
||||
build replaces them as a whole only when the page asks (once the player
|
||||
agrees). version.json?latest always asks the network, so that the page can
|
||||
tell a new build is out.
|
||||
tell a new build is out;
|
||||
- it takes the game's wasm, most of a build, from the copy version.json
|
||||
names (jsDelivr's, of the commit the deployment pushed it in:
|
||||
.github/workflows/build.yml's pages job), checked against its SHA-256,
|
||||
and from the site only when that copy cannot be had: GitHub Pages serves
|
||||
100 GB a month. The page loads halo.wasm from the site as before, which
|
||||
this worker then serves from its cache.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -38,13 +44,42 @@ async function setActiveVersion(version) {
|
||||
await meta.put('active', new Response(JSON.stringify({ version })));
|
||||
}
|
||||
|
||||
// a build's files into a cache of their own; then it is the one served, and
|
||||
// the others go
|
||||
const WASM = 'halo.wasm';
|
||||
|
||||
function hex(bytes) {
|
||||
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
|
||||
// the build's wasm from the copy its version.json names ({url, sha256}: an
|
||||
// https address and the file's SHA-256), as a response to keep; null when
|
||||
// there is none, or it cannot be fetched or is not that file
|
||||
async function mirroredWasm(stamp) {
|
||||
const mirror = stamp.wasm;
|
||||
if (!mirror || typeof mirror.url !== 'string' || !mirror.url.startsWith('https://') ||
|
||||
!/^[0-9a-f]{64}$/.test(mirror.sha256 || '')) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const response = await fetch(mirror.url, { mode: 'cors', credentials: 'omit' });
|
||||
if (!response.ok) return null;
|
||||
const bytes = await response.arrayBuffer();
|
||||
if (hex(await crypto.subtle.digest('SHA-256', bytes)) !== mirror.sha256) return null;
|
||||
return new Response(bytes, { status: 200, headers: { 'Content-Type': 'application/wasm' } });
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// a build's files into a cache of their own (its wasm from its copy where it
|
||||
// has one); then it is the one served, and the others go
|
||||
async function installVersion(stamp) {
|
||||
const name = CACHE_PREFIX + stamp.version;
|
||||
const cache = await caches.open(name);
|
||||
const files = ['./', 'version.json', ...stamp.files.filter((file) => file !== 'version.json')];
|
||||
const wasm = stamp.files.includes(WASM) ? await mirroredWasm(stamp) : null;
|
||||
const files = ['./', 'version.json',
|
||||
...stamp.files.filter((file) => file !== 'version.json' && !(wasm && file === WASM))];
|
||||
await cache.addAll(files.map((path) => new Request(path, { cache: 'no-store' })));
|
||||
if (wasm) await cache.put(new Request(WASM), wasm);
|
||||
await setActiveVersion(stamp.version);
|
||||
for (const other of await caches.keys()) {
|
||||
if (other.startsWith(CACHE_PREFIX) && other !== name && other !== META_CACHE) await caches.delete(other);
|
||||
@@ -129,5 +164,5 @@ self.addEventListener('message', (event) => {
|
||||
|
||||
// (for the tests: port/web/tests)
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = { isolated, installVersion, activeVersion, cachedResponse, respond, CACHE_PREFIX };
|
||||
module.exports = { isolated, installVersion, activeVersion, cachedResponse, respond, mirroredWasm, CACHE_PREFIX };
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert');
|
||||
const { createHash } = require('node:crypto');
|
||||
|
||||
const ORIGIN = 'https://halocombatevolved.com';
|
||||
|
||||
@@ -65,9 +66,13 @@ class FakeCacheStorage {
|
||||
}
|
||||
}
|
||||
|
||||
// the addresses the fake network was asked for, in turn
|
||||
let fetched = [];
|
||||
|
||||
globalThis.fetch = async (request) => {
|
||||
const url = new URL(typeof request === 'string' ? request : request.url, ORIGIN + '/');
|
||||
const name = url.pathname.replace(/^\//, '');
|
||||
fetched.push(url.href);
|
||||
if (!(name in served)) return new Response('missing', { status: 404 });
|
||||
return new Response(served[name], { status: 200, headers: { 'Content-Type': 'text/plain' } });
|
||||
};
|
||||
@@ -132,3 +137,47 @@ test('a build whose files cannot all be fetched is not made the one served', asy
|
||||
await assert.rejects(sw.installVersion(JSON.parse(served['version.json'])));
|
||||
assert.strictEqual(await sw.activeVersion(), 'dddd');
|
||||
});
|
||||
|
||||
// the wasm's copy on jsDelivr, as the deployment names it in version.json
|
||||
const MIRROR = 'https://cdn.jsdelivr.net/gh/OpenCommunityEdition/OpenCE@0123abcd/halo.wasm';
|
||||
|
||||
function serveMirrored(version, wasm, sha256) {
|
||||
serve(version, { 'index.html': `<page ${version}>`, 'halo.js': `js ${version}`, 'halo.wasm': `site ${wasm}` });
|
||||
served[new URL(MIRROR).pathname.replace(/^\//, '')] = wasm;
|
||||
const stamp = JSON.parse(served['version.json']);
|
||||
stamp.wasm = { url: MIRROR, sha256: sha256 || createHash('sha256').update(wasm).digest('hex') };
|
||||
served['version.json'] = JSON.stringify(stamp);
|
||||
return stamp;
|
||||
}
|
||||
|
||||
test("the wasm comes from its copy, not the site, when the copy is the file", async () => {
|
||||
const stamp = serveMirrored('ffff', 'wasm f');
|
||||
fetched = [];
|
||||
await sw.installVersion(stamp);
|
||||
assert.ok(fetched.includes(MIRROR));
|
||||
assert.ok(!fetched.includes(ORIGIN + '/halo.wasm'), 'the site served the wasm');
|
||||
assert.strictEqual(await (await sw.respond(new Request(ORIGIN + '/halo.wasm'))).text(), 'wasm f');
|
||||
});
|
||||
|
||||
test("a copy that is not the file is not kept: the site's wasm is", async () => {
|
||||
const stamp = serveMirrored('gggg', 'wasm g', '0'.repeat(64));
|
||||
fetched = [];
|
||||
await sw.installVersion(stamp);
|
||||
assert.ok(fetched.includes(ORIGIN + '/halo.wasm'));
|
||||
assert.strictEqual(await (await sw.respond(new Request(ORIGIN + '/halo.wasm'))).text(), 'site wasm g');
|
||||
});
|
||||
|
||||
test("a copy that cannot be fetched leaves the site's wasm", async () => {
|
||||
const stamp = serveMirrored('hhhh', 'wasm h');
|
||||
delete served[new URL(MIRROR).pathname.replace(/^\//, '')];
|
||||
await sw.installVersion(stamp);
|
||||
assert.strictEqual(await (await sw.respond(new Request(ORIGIN + '/halo.wasm'))).text(), 'site wasm h');
|
||||
});
|
||||
|
||||
test('a copy elsewhere than https is never fetched', async () => {
|
||||
const stamp = serveMirrored('iiii', 'wasm i');
|
||||
stamp.wasm.url = 'http://cdn.jsdelivr.net/x/halo.wasm';
|
||||
fetched = [];
|
||||
assert.strictEqual(await sw.mirroredWasm(stamp), null);
|
||||
assert.deepStrictEqual(fetched, []);
|
||||
});
|
||||
@@ -571,6 +571,7 @@ symbols in this file:
|
||||
#include "network_coop.h" /* port: port/linux/game/network_coop.c */
|
||||
#include "network_votekick.h" /* port: port/linux/game/network_votekick.c */
|
||||
#include "network_voice.h" /* port: port/linux/game/network_voice.c */
|
||||
#include "network_chat.h" /* port: port/linux/game/network_chat.c */
|
||||
/* (network_server_manager_internal.h's: the host's game record) */
|
||||
struct network_game *network_game_server_get_game(struct network_game_server *server);
|
||||
#include "objects.h"
|
||||
@@ -1867,12 +1868,14 @@ static boolean scoreboard_team_columns(
|
||||
/* a network game's scoreboard picks players with the mouse
|
||||
(halo_scoreboard_pointer_update: a right click frees it): a player's name
|
||||
picked opens a menu of what may be done to them, the players' vote to kick
|
||||
them (network_votekick.c), muting their voice (network_voice.c), and the
|
||||
host's Kick and Ban, Ban picked twice */
|
||||
them (network_votekick.c), muting their voice and text chat on this
|
||||
machine (network_voice.c, network_chat.c), and the host's Mute for everyone
|
||||
(network_chat.c), Kick and Ban, Ban picked twice */
|
||||
enum
|
||||
{
|
||||
_scoreboard_item_vote,
|
||||
_scoreboard_item_mute,
|
||||
_scoreboard_item_host_mute,
|
||||
_scoreboard_item_kick,
|
||||
_scoreboard_item_ban,
|
||||
_scoreboard_item_cancel,
|
||||
@@ -1932,20 +1935,26 @@ static void scoreboard_menu_items(
|
||||
{
|
||||
usprintf(labels[_scoreboard_item_vote], L"Start a vote to kick");
|
||||
}
|
||||
/* (its machine's voice: this machine's own choice) */
|
||||
/* (its machine's voice and text chat lines: this machine's own choice) */
|
||||
{
|
||||
struct player_datum *player = player_try_and_get(scoreboard_menu.player_index);
|
||||
|
||||
if (player && network_voice_available())
|
||||
if (player)
|
||||
{
|
||||
offered[_scoreboard_item_mute] = TRUE;
|
||||
usprintf(labels[_scoreboard_item_mute],
|
||||
network_voice_machine_muted(player->network_player_data.machine_index) ? L"Unmute voice" :
|
||||
L"Mute voice");
|
||||
network_voice_machine_muted(player->network_player_data.machine_index) ? L"Unmute voice and chat" :
|
||||
L"Mute voice and chat");
|
||||
}
|
||||
}
|
||||
if (network_votekick_host())
|
||||
{
|
||||
/* (the host's mute of their voice and lines, for every machine:
|
||||
network_chat.c) */
|
||||
offered[_scoreboard_item_host_mute] = TRUE;
|
||||
usprintf(labels[_scoreboard_item_host_mute],
|
||||
network_chat_host_mute_minutes((short)DATUM_INDEX_TO_ABSOLUTE_INDEX(scoreboard_menu.player_index)) ?
|
||||
L"Unmute for everyone" : L"Mute for everyone");
|
||||
offered[_scoreboard_item_kick] = TRUE;
|
||||
offered[_scoreboard_item_ban] = TRUE;
|
||||
usprintf(labels[_scoreboard_item_kick], L"Kick");
|
||||
@@ -2016,6 +2025,9 @@ static void scoreboard_menu_pick(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case _scoreboard_item_host_mute:
|
||||
network_chat_host_mute(player_index, !network_chat_host_mute_minutes(player_index));
|
||||
break;
|
||||
case _scoreboard_item_kick:
|
||||
network_votekick_host_kick(player_index, FALSE);
|
||||
break;
|
||||
|
||||
@@ -109,6 +109,7 @@ symbols in this file:
|
||||
#include "text/draw_string.h"
|
||||
#include "coop_spectate.h" /* port: port/linux/game/coop_spectate.c */
|
||||
#include "network_coop.h" /* port: port/linux/game/network_coop.c */
|
||||
#include "network_chat.h" /* port: port/linux/game/network_chat.c */
|
||||
#include "text/font_group.h"
|
||||
#include "text/text_group.h"
|
||||
#include "units/unit_definitions.h"
|
||||
@@ -1538,6 +1539,8 @@ void hud_draw_screen(
|
||||
}
|
||||
|
||||
hud_messaging_update(render.local_player_index);
|
||||
/* port: network games' text chat, the lines this view's player hears */
|
||||
network_chat_draw(render.local_player_index);
|
||||
}
|
||||
|
||||
rasterizer_hud_end();
|
||||
|
||||
@@ -1545,6 +1545,9 @@ void hud_draw_static_element(
|
||||
return;
|
||||
}
|
||||
|
||||
/* port: the left of the last picture drawn (hud_draw.h) */
|
||||
short hud_draw_last_left;
|
||||
|
||||
static void hud_draw_bitmap_internal(
|
||||
void *meter_parameters,
|
||||
struct bitmap_data const *bitmap,
|
||||
@@ -1585,6 +1588,11 @@ static void hud_draw_bitmap_internal(
|
||||
vertices[vertex_index].color = color;
|
||||
}
|
||||
|
||||
/* port: where it is drawn (hud_draw_last_left) */
|
||||
hud_draw_last_left = SHORT_MAX;
|
||||
for (vertex_index = 0; vertex_index < 4; vertex_index++)
|
||||
hud_draw_last_left = (short)MIN(hud_draw_last_left, vertices[vertex_index].position.x);
|
||||
|
||||
if (reticle_scale != 1.0f)
|
||||
{
|
||||
real center_x = (render.camera.window_bounds.x1 + render.camera.window_bounds.x0) / 2 -
|
||||
|
||||
@@ -145,6 +145,11 @@ void hud_draw_numbers(
|
||||
long flash_reference_time,
|
||||
real override_scale);
|
||||
|
||||
/* port: the left of the last picture drawn, in the window's units
|
||||
(hud_unit.c: the motion sensor's, which the text chat goes above:
|
||||
port/linux/game/network_chat.c) */
|
||||
extern short hud_draw_last_left;
|
||||
|
||||
/* ---------- public code */
|
||||
|
||||
__inline short check_stack_buffer(
|
||||
|
||||
@@ -86,6 +86,7 @@ symbols in this file:
|
||||
#include "tag_files/tag_groups.h"
|
||||
#include "units/unit_definitions.h"
|
||||
#include "units/units.h"
|
||||
#include "network_chat.h" /* port: port/linux/game/network_chat.c */
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
@@ -1135,6 +1136,8 @@ void hud_render_unit_interface(
|
||||
struct hud_absolute_placement_definition absolute_placement;
|
||||
short draw_flags = 0;
|
||||
point2d corner;
|
||||
/* port: its picture's left (NONE: none drawn) */
|
||||
short motion_sensor_left = NONE;
|
||||
|
||||
absolute_placement.corner = _hud_anchor_bottom_left;
|
||||
SET_FLAG(
|
||||
@@ -1160,12 +1163,16 @@ void hud_render_unit_interface(
|
||||
|
||||
if (hud_definition->motion_sensor.background.interface_bitmap.index != NONE)
|
||||
{
|
||||
/* port: none, unless it is drawn (its bitmap can be missing) */
|
||||
hud_draw_last_left = NONE;
|
||||
hud_draw_static_element(
|
||||
local_player_index,
|
||||
&absolute_placement,
|
||||
&hud_definition->motion_sensor.background,
|
||||
draw_flags,
|
||||
NONE);
|
||||
/* port: where it is (the text chat goes above it) */
|
||||
motion_sensor_left = hud_draw_last_left;
|
||||
}
|
||||
if (hud_definition->motion_sensor.foreground.interface_bitmap.index != NONE)
|
||||
{
|
||||
@@ -1189,6 +1196,14 @@ void hud_render_unit_interface(
|
||||
local_player_index,
|
||||
local_player_count() > 1,
|
||||
&corner);
|
||||
/* port: the text chat goes above it: the top of its circle, as
|
||||
far above the blips' centre as the picture's left edge is left
|
||||
of it (the picture is taller than the circle) */
|
||||
if (motion_sensor_left != NONE)
|
||||
{
|
||||
network_chat_note_motion_sensor(local_player_index, motion_sensor_left,
|
||||
(short)(corner.y - (corner.x - motion_sensor_left)));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -65,6 +65,7 @@ symbols in this file:
|
||||
#include "tag_groups.h"
|
||||
#include "text_group.h"
|
||||
#include "font_group.h"
|
||||
#include "text_filter.h" /* port: port/linux/game/text_filter.c */
|
||||
|
||||
#ifdef HALO_ANDROID
|
||||
#include "halo_vr.h"
|
||||
@@ -257,7 +258,11 @@ void terminal_draw(
|
||||
}
|
||||
buffer[cursor_index] = '_';
|
||||
}
|
||||
/* port: the line being typed drawn as it is, not hidden by streamer
|
||||
mode (port/linux/game/text_filter.c) */
|
||||
text_filter_suspend();
|
||||
rasterizer_draw_string(&terminal_gets_bounds, NULL, NULL, 0, buffer);
|
||||
text_filter_resume();
|
||||
}
|
||||
|
||||
if (terminal_render_enable)
|
||||
|
||||
@@ -8458,6 +8458,7 @@ static void ui_vr_controls_render(
|
||||
ui_vr_controls_add_action(columns, ui_vr_input_action(HALO_VR_INPUT_X), FALSE);
|
||||
ui_vr_controls_add_action(columns, ui_vr_input_action(HALO_VR_INPUT_Y), FALSE);
|
||||
ui_vr_controls_add(&columns[0], "Menu", "Pause");
|
||||
ui_vr_controls_add(&columns[0], "Menu held", "Scores");
|
||||
ui_vr_controls_note(320, wrist_note);
|
||||
ui_vr_controls_note(340, "Scope: zoom, and look through the disc above the weapon.");
|
||||
ui_vr_controls_note(360, "Hold the Meta button to recentre the view.");
|
||||
|
||||
@@ -96,6 +96,7 @@ symbols in this file:
|
||||
#include "text/font_group.h"
|
||||
#include "text/text_group.h"
|
||||
#include "text/unicode.h"
|
||||
#include "text_filter.h" /* port: port/linux/game/text_filter.c */
|
||||
|
||||
#ifdef HALO_ANDROID
|
||||
#include "halo_vr.h"
|
||||
@@ -709,6 +710,9 @@ static void virtual_keyboard_render_internal(
|
||||
rasterizer_draw_unicode_string(&bounds, &bounds, NULL, 0, caption);
|
||||
}
|
||||
|
||||
/* port: the text being typed drawn as it is, not hidden by streamer mode
|
||||
(port/linux/game/text_filter.c) */
|
||||
text_filter_suspend();
|
||||
draw_string_set_draw_mode(virtual_keyboard_globals.keyboard->font_tag.index, NONE, 2, 0, &text_color);
|
||||
{
|
||||
rectangle2d bounds;
|
||||
@@ -734,6 +738,7 @@ static void virtual_keyboard_render_internal(
|
||||
}
|
||||
rasterizer_draw_unicode_string(&bounds, &bounds, NULL, 0, virtual_keyboard_globals.text_buffer);
|
||||
}
|
||||
text_filter_resume(); /* port */
|
||||
|
||||
if (!virtual_keyboard_globals.first_key_replaces_buffer &&
|
||||
virtual_keyboard_globals.caret_bitmap_index != NONE &&
|
||||
|
||||
@@ -381,6 +381,7 @@ symbols in this file:
|
||||
#include "networking/network_server_manager.h" /* port: a co-op game's level won */
|
||||
#include "network_coop.h" /* port: port/linux/game/network_coop.c */
|
||||
#include "network_voice.h" /* port: port/linux/game/network_voice.c */
|
||||
#include "network_chat.h" /* port: port/linux/game/network_chat.c */
|
||||
#include "map_share.h" /* port: port/linux/game/map_share.c */
|
||||
#include "profile_sections.h" /* port: port/linux/include/profile_sections.h */
|
||||
#ifdef HALO_PROFILE
|
||||
@@ -3532,6 +3533,8 @@ static boolean main_loop_iteration(
|
||||
network_voice_update();
|
||||
/* port: map sharing, in the lobby and in game (port/linux/game/map_share.c) */
|
||||
map_share_update();
|
||||
/* port: network games' text chat (port/linux/game/network_chat.c) */
|
||||
network_chat_update();
|
||||
profile_scope_enter(main_network_start_frame_section)
|
||||
connection = main_globals.connection;
|
||||
if (connection==_game_connection_network_client)
|
||||
@@ -3591,7 +3594,9 @@ static boolean main_loop_iteration(
|
||||
|
||||
if (!console_update() || main_globals.connection!=_game_connection_local)
|
||||
{
|
||||
debug_keys_update();
|
||||
/* port: not while a chat line is typed (its K plays an animation) */
|
||||
if (!network_chat_typing())
|
||||
debug_keys_update();
|
||||
cheats_update();
|
||||
player_control_update((real)main_globals.halt_time_scale*main_globals.seconds_elapsed);
|
||||
|
||||
|
||||
@@ -717,7 +717,7 @@ desktop none is ever marked, the writes live behind the Android guard) */
|
||||
static boolean network_game_server_bot_machines[MAXIMUM_NETWORK_MACHINE_COUNT];
|
||||
#ifdef HALO_ANDROID
|
||||
static short network_game_server_bot_machine_count(struct network_game_server *server);
|
||||
static boolean network_game_server_room_for_person(struct network_game_server *server);
|
||||
boolean network_game_server_room_for_person(struct network_game_server *server);
|
||||
static void network_game_server_bot_makes_room(struct network_game_server *server);
|
||||
#endif
|
||||
|
||||
@@ -4951,7 +4951,9 @@ static short network_game_server_bot_count(
|
||||
|
||||
/* whether a person can join: a free place, or in the lobby a bot's, which
|
||||
leaves for them (network_game_server_bot_makes_room) */
|
||||
static boolean network_game_server_room_for_person(
|
||||
/* (as the server browser lists the game, its LAN advertisement and the
|
||||
join's check: network_server_message_handler.c) */
|
||||
boolean network_game_server_room_for_person(
|
||||
struct network_game_server *server)
|
||||
{
|
||||
struct network_player *last;
|
||||
|
||||
@@ -245,6 +245,7 @@ symbols in this file:
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ---------- headers */
|
||||
|
||||
#include "cseries.h"
|
||||
@@ -275,6 +276,13 @@ boolean map_share_handles_message(word const *message, word size);
|
||||
void map_share_handle_message(long machine_index, word const *message, word size, boolean from_stream);
|
||||
void network_distributed_handle_stream_message(long machine_index, word const *message, word size);
|
||||
|
||||
|
||||
#ifdef HALO_ANDROID
|
||||
/* a slot for a person, a bot's in a lobby counting (it makes room as they
|
||||
join: network_server_manager.c) */
|
||||
boolean network_game_server_room_for_person(struct network_game_server *server);
|
||||
#endif
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
enum
|
||||
@@ -1769,7 +1777,12 @@ static boolean network_game_server_handle_message_client_broadcast_game_search(
|
||||
once it is over, nor in progress when no player can join it) */
|
||||
if (network_game_server_get_state(server, NULL) == _network_game_server_state_ingame
|
||||
? network_game_server_accepts_late_joins(server)
|
||||
#ifdef HALO_ANDROID
|
||||
/* (a lobby the bots fill is open: one makes room) */
|
||||
: network_game_server_game_is_open(server) && network_game_server_room_for_person(server))
|
||||
#else
|
||||
: network_game_server_game_is_open(server) && network_game_has_free_player_slot(game))
|
||||
#endif
|
||||
{
|
||||
advertisement.flags |= FLAG(_game_advertisement_open_bit);
|
||||
}
|
||||
@@ -1923,7 +1936,12 @@ static boolean network_game_server_handle_message_client_join_game_request(
|
||||
fill it) is full: a machine that joined could add none, and held
|
||||
the countdown for ever */
|
||||
boolean full = network_game_server_get_state(server, NULL) == _network_game_server_state_pregame &&
|
||||
#ifdef HALO_ANDROID
|
||||
/* (a bot's slot is a person's: it makes room) */
|
||||
!network_game_server_room_for_person(server);
|
||||
#else
|
||||
!network_game_has_free_player_slot(network_game_server_get_game(server));
|
||||
#endif
|
||||
|
||||
/* port: its hardware id, as it tells it: hex only (anything else
|
||||
left out), no more than its field; the host logs it, and refuses
|
||||
|
||||
@@ -116,6 +116,7 @@ symbols in this file:
|
||||
#include "text/font_group.h"
|
||||
#include "text/international_strings.h"
|
||||
#include "text/text_group.h"
|
||||
#include "text_filter.h" /* port: port/linux/game/text_filter.c and text_filter_match.c */
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -1012,6 +1013,10 @@ void draw_string(
|
||||
struct parse_string_state state;
|
||||
point2d cursor;
|
||||
|
||||
/* port: streamer mode's words hidden, in what is drawn and what is measured
|
||||
(port/linux/game/text_filter.c) */
|
||||
string = text_filter_string(string);
|
||||
|
||||
match_assert("c:\\halo\\SOURCE\\text\\draw_string.c", 648, bounds);
|
||||
match_assert("c:\\halo\\SOURCE\\text\\draw_string.c", 649, string);
|
||||
|
||||
@@ -1210,6 +1215,10 @@ void draw_unicode_string(
|
||||
struct parse_string_state state;
|
||||
point2d cursor;
|
||||
|
||||
/* port: streamer mode's words hidden, in what is drawn and what is measured
|
||||
(port/linux/game/text_filter.c) */
|
||||
string = text_filter_unicode(string);
|
||||
|
||||
match_assert("c:\\halo\\SOURCE\\text\\draw_string.c", 848, bounds);
|
||||
match_assert("c:\\halo\\SOURCE\\text\\draw_string.c", 849, string);
|
||||
|
||||
|
||||
@@ -643,9 +643,9 @@ def main() -> None:
|
||||
((ROOT / "port/assets/icons/lucide" / f"{icon}.svg").read_text().replace('stroke="currentColor"',
|
||||
'stroke="#FFFFFF"'), 24, 24)
|
||||
for icon in ("volume-2", "volume-x")]))
|
||||
# (the main menu's MODS, in OpenCE as the redraws' items are, and the mods'
|
||||
# (the main menu's MODS, in the redraws' own letters, and the mods'
|
||||
# status icons: Lucide's, port/assets/icons/lucide)
|
||||
lines.append(art.port_picture("main_menu/menu_mods", port_settings.menu_item_frames("MODS")))
|
||||
lines.append(art.port_picture("main_menu/menu_mods", port_settings.menu_item_frames("MODS", art.redraws)))
|
||||
lines.append(art.port_picture("mods/status", port_settings.mod_status_frames(ROOT / "port/assets/icons/lucide")))
|
||||
lines.append(art.port_picture("mods/status_small",
|
||||
port_settings.mod_status_frames(ROOT / "port/assets/icons/lucide", 16)))
|
||||
|
||||
@@ -0,0 +1,505 @@
|
||||
/*
|
||||
CHAT_LOGIC.C (test)
|
||||
|
||||
The rules of port/linux/game/network_chat.c's text chat: what a line's text
|
||||
may hold (another machine's is untrusted), how many lines the host takes
|
||||
from a machine, who hears a team's line, how long a line shows, and the
|
||||
host's /mute (what it reads from a line, the player a name means, how long a
|
||||
mute lasts), the links it can refuse and which lines its settings refuse.
|
||||
test_chat_logic.py takes the constants and structures (config.inc) and the
|
||||
code (under_test.inc).
|
||||
*/
|
||||
|
||||
#include "harness.h"
|
||||
|
||||
#ifndef NUMBEROF
|
||||
#define NUMBEROF(array) (sizeof(array) / sizeof((array)[0]))
|
||||
#endif
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define csstrlen strlen
|
||||
#define csstrcmp strcmp
|
||||
#define csstrncpy strncpy
|
||||
|
||||
#include "config.inc"
|
||||
#include "under_test.inc"
|
||||
|
||||
/* the text cleaned from a source of size bytes */
|
||||
static short clean(
|
||||
char *text,
|
||||
char const *source,
|
||||
short size)
|
||||
{
|
||||
return chat_text_clean(text, source, size);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char const *case_name = argc > 1 ? argv[1] : "";
|
||||
char text[CHAT_TEXT_SIZE];
|
||||
char source[256];
|
||||
|
||||
/* printable ASCII kept as it is, the spaces at its ends dropped */
|
||||
CASE("text-printable")
|
||||
{
|
||||
CHECK(clean(text, " eat my dedi ", 64) == 11, "length %d", (int)strlen(text));
|
||||
CHECK(!strcmp(text, "eat my dedi"), "'%s'", text);
|
||||
CHECK(clean(text, "a~!{}", 64) == 5 && !strcmp(text, "a~!{}"), "'%s'", text);
|
||||
}
|
||||
|
||||
/* control characters, DEL and bytes past ASCII never reach the screen */
|
||||
CASE("text-control-characters")
|
||||
{
|
||||
CHECK(clean(text, "a\tb\x1b" "c\x7f" "d\xe9", 64) == 8, "length %d", (int)strlen(text));
|
||||
CHECK(!strcmp(text, "a?b?c?d?"), "'%s'", text);
|
||||
}
|
||||
|
||||
/* "|", which the game's text drawing takes for the start of a code (one
|
||||
at a line's end reads past it), never reaches the screen, sent or typed */
|
||||
CASE("text-pipe")
|
||||
{
|
||||
char line[CHAT_TEXT_SIZE] = "a";
|
||||
|
||||
CHECK(clean(text, "gg|", 64) == 3 && !strcmp(text, "gg?"), "'%s'", text);
|
||||
CHECK(clean(text, "a|nb", 64) == 4 && !strcmp(text, "a?nb"), "'%s'", text);
|
||||
chat_text_append(line, "|b|");
|
||||
CHECK(!strcmp(line, "ab"), "'%s'", line);
|
||||
}
|
||||
|
||||
/* a message cut at CHAT_TEXT_SIZE - 1 characters, and never read past
|
||||
its buffer when another machine sent it unended */
|
||||
CASE("text-bounds")
|
||||
{
|
||||
memset(source, 'x', sizeof(source));
|
||||
CHECK(clean(text, source, sizeof(source)) == CHAT_TEXT_SIZE - 1, "length %d", (int)strlen(text));
|
||||
CHECK(text[CHAT_TEXT_SIZE - 1] == 0, "not ended");
|
||||
memset(source, 'y', sizeof(source));
|
||||
source[10] = 'z';
|
||||
CHECK(clean(text, source, 5) == 5 && !strcmp(text, "yyyyy"), "read past its size: '%s'", text);
|
||||
}
|
||||
|
||||
/* nothing but spaces is no line */
|
||||
CASE("text-empty")
|
||||
{
|
||||
CHECK(clean(text, " ", 64) == 0 && !text[0], "'%s'", text);
|
||||
CHECK(clean(text, "", 64) == 0, "'%s'", text);
|
||||
}
|
||||
|
||||
/* typing and pasting: printable ASCII only, no further than a line holds */
|
||||
CASE("append")
|
||||
{
|
||||
char line[CHAT_TEXT_SIZE] = "hi";
|
||||
|
||||
chat_text_append(line, " there\n\x01!");
|
||||
CHECK(!strcmp(line, "hi there!"), "'%s'", line);
|
||||
memset(source, 'w', 200);
|
||||
source[200] = 0;
|
||||
chat_text_append(line, source);
|
||||
CHECK(strlen(line) == CHAT_TEXT_SIZE - 1, "length %d", (int)strlen(line));
|
||||
}
|
||||
|
||||
/* CHAT_BURST lines at once, then one a period */
|
||||
CASE("rate-burst")
|
||||
{
|
||||
struct chat_rate rate;
|
||||
unsigned long now = 1000;
|
||||
int index;
|
||||
|
||||
memset(&rate, 0, sizeof(rate));
|
||||
for (index = 0; index < CHAT_BURST; index++)
|
||||
CHECK(chat_rate_take(&rate, now), "line %d of the burst refused", index);
|
||||
CHECK(!chat_rate_take(&rate, now), "a line past the burst taken");
|
||||
CHECK(!chat_rate_take(&rate, now + CHAT_REFILL_MILLISECONDS - 1), "a line taken before its period");
|
||||
CHECK(chat_rate_take(&rate, now + CHAT_REFILL_MILLISECONDS), "the line a period later refused");
|
||||
CHECK(!chat_rate_take(&rate, now + CHAT_REFILL_MILLISECONDS), "two lines in one period");
|
||||
}
|
||||
|
||||
/* a machine quiet a long while has its burst again, and no more */
|
||||
CASE("rate-refill")
|
||||
{
|
||||
struct chat_rate rate;
|
||||
unsigned long now = 5000;
|
||||
int index;
|
||||
int taken = 0;
|
||||
|
||||
memset(&rate, 0, sizeof(rate));
|
||||
for (index = 0; index < CHAT_BURST; index++)
|
||||
chat_rate_take(&rate, now);
|
||||
now += 100 * CHAT_REFILL_MILLISECONDS;
|
||||
for (index = 0; index < 4 * CHAT_BURST; index++)
|
||||
taken += chat_rate_take(&rate, now);
|
||||
CHECK(taken == CHAT_BURST, "%d lines taken at once after a long quiet", taken);
|
||||
}
|
||||
|
||||
/* the clock wrapping round (system_milliseconds) changes nothing */
|
||||
CASE("rate-wrap")
|
||||
{
|
||||
struct chat_rate rate;
|
||||
unsigned long now = 0xFFFFFFFFUL - 200;
|
||||
int index;
|
||||
|
||||
memset(&rate, 0, sizeof(rate));
|
||||
for (index = 0; index < CHAT_BURST; index++)
|
||||
CHECK(chat_rate_take(&rate, now), "line %d refused", index);
|
||||
CHECK(!chat_rate_take(&rate, now + 300), "a line taken past the burst across the wrap");
|
||||
CHECK(chat_rate_take(&rate, now + CHAT_REFILL_MILLISECONDS), "the line a period later refused across the wrap");
|
||||
}
|
||||
|
||||
/* a team's line by that team alone, or by everyone without teams */
|
||||
CASE("hears")
|
||||
{
|
||||
CHECK(chat_hears(_chat_channel_everyone, TRUE, 0, 1, NONE, 7), "a line to everyone not heard by the other team");
|
||||
CHECK(chat_hears(_chat_channel_team, TRUE, 1, 1, NONE, NONE), "a team's line not heard by the team");
|
||||
CHECK(!chat_hears(_chat_channel_team, TRUE, 0, 1, 7, 7), "a team's line heard by the other team");
|
||||
CHECK(chat_hears(_chat_channel_team, FALSE, 0, 1, NONE, NONE), "a team's line not heard without teams");
|
||||
}
|
||||
|
||||
/* a vehicle's line by those riding in the sender's vehicle alone, of any
|
||||
team; by no one when the sender rides in none */
|
||||
CASE("hears-vehicle")
|
||||
{
|
||||
CHECK(chat_hears(_chat_channel_vehicle, TRUE, 0, 1, 7, 7), "not heard in the same vehicle (another team)");
|
||||
CHECK(!chat_hears(_chat_channel_vehicle, TRUE, 0, 0, 7, 8), "heard in another vehicle");
|
||||
CHECK(!chat_hears(_chat_channel_vehicle, TRUE, 0, 0, 7, NONE), "heard on foot");
|
||||
CHECK(!chat_hears(_chat_channel_vehicle, FALSE, 0, 0, NONE, NONE), "heard on foot from a sender on foot");
|
||||
}
|
||||
|
||||
/* a line's channel through its flags, as sent */
|
||||
CASE("flags")
|
||||
{
|
||||
short channel;
|
||||
|
||||
for (channel = 0; channel < NUMBER_OF_CHAT_CHANNELS; channel++)
|
||||
CHECK(chat_channel_from_flags(chat_channel_flags(channel)) == channel, "channel %d came back as %d",
|
||||
channel, chat_channel_from_flags(chat_channel_flags(channel)));
|
||||
CHECK(chat_channel_from_flags(0) == _chat_channel_everyone, "no flags is not everyone");
|
||||
}
|
||||
|
||||
/* shown whole, then fading, then gone; whole while a line is typed */
|
||||
CASE("alpha")
|
||||
{
|
||||
CHECK(chat_line_alpha(0, FALSE) == 1.0f, "a new line faded");
|
||||
CHECK(chat_line_alpha(CHAT_LINE_MILLISECONDS - 1, FALSE) == 1.0f, "faded early");
|
||||
CHECK(chat_line_alpha(CHAT_LINE_MILLISECONDS + CHAT_FADE_MILLISECONDS / 2, FALSE) > 0.4f &&
|
||||
chat_line_alpha(CHAT_LINE_MILLISECONDS + CHAT_FADE_MILLISECONDS / 2, FALSE) < 0.6f, "not half way");
|
||||
CHECK(chat_line_alpha(CHAT_LINE_MILLISECONDS + CHAT_FADE_MILLISECONDS, FALSE) == 0.0f, "still shown");
|
||||
CHECK(chat_line_alpha(10 * CHAT_LINE_MILLISECONDS, TRUE) == 1.0f, "faded while typing");
|
||||
}
|
||||
|
||||
/* /mute: the player (a name of more than one word too) and the minutes,
|
||||
the word in either case; the default when it gives none, a day at most;
|
||||
the name cut to its buffer */
|
||||
CASE("command-mute")
|
||||
{
|
||||
struct
|
||||
{
|
||||
char name[8];
|
||||
char canary[64];
|
||||
} bounded;
|
||||
char name[CHAT_TEXT_SIZE];
|
||||
short minutes = 0;
|
||||
|
||||
CHECK(chat_command_parse("/mute Milenko 5", name, sizeof(name), &minutes) == _chat_command_mute,
|
||||
"not a mute");
|
||||
CHECK(!strcmp(name, "Milenko") && minutes == 5, "'%s' %d", name, minutes);
|
||||
CHECK(chat_command_parse("/MUTE Master Chief 12", name, sizeof(name), &minutes) == _chat_command_mute,
|
||||
"not a mute in capitals");
|
||||
CHECK(!strcmp(name, "Master Chief") && minutes == 12, "'%s' %d", name, minutes);
|
||||
CHECK(chat_command_parse("/mute jonas", name, sizeof(name), &minutes) == _chat_command_mute &&
|
||||
!strcmp(name, "jonas") && minutes == CHAT_MUTE_DEFAULT_MINUTES, "'%s' %d", name, minutes);
|
||||
/* (a name all digits, alone, is the name) */
|
||||
CHECK(chat_command_parse("/mute 1337", name, sizeof(name), &minutes) == _chat_command_mute &&
|
||||
!strcmp(name, "1337") && minutes == CHAT_MUTE_DEFAULT_MINUTES, "'%s' %d", name, minutes);
|
||||
/* (a last word not all digits is the name's) */
|
||||
CHECK(chat_command_parse("/mute agent 47b", name, sizeof(name), &minutes) == _chat_command_mute &&
|
||||
!strcmp(name, "agent 47b") && minutes == CHAT_MUTE_DEFAULT_MINUTES, "'%s' %d", name, minutes);
|
||||
CHECK(chat_command_parse("/mute x 99999999999999999999", name, sizeof(name), &minutes) == _chat_command_mute &&
|
||||
minutes == CHAT_MUTE_MAXIMUM_MINUTES, "%d minutes", minutes);
|
||||
memset(&bounded, 'Z', sizeof(bounded));
|
||||
chat_command_parse("/mute averyveryverylongname 3", bounded.name, sizeof(bounded.name), &minutes);
|
||||
CHECK(bounded.canary[0] == 'Z' && strlen(bounded.name) == sizeof(bounded.name) - 1, "the name overran: '%s'",
|
||||
bounded.name);
|
||||
}
|
||||
|
||||
CASE("command-unmute")
|
||||
{
|
||||
char name[CHAT_TEXT_SIZE];
|
||||
short minutes = 0;
|
||||
|
||||
CHECK(chat_command_parse("/unmute Milenko", name, sizeof(name), &minutes) == _chat_command_unmute &&
|
||||
!strcmp(name, "Milenko"), "'%s'", name);
|
||||
/* (an unmute takes no minutes: a last word of digits is the name's) */
|
||||
CHECK(chat_command_parse("/Unmute Milenko 5", name, sizeof(name), &minutes) == _chat_command_unmute &&
|
||||
!strcmp(name, "Milenko 5"), "'%s'", name);
|
||||
}
|
||||
|
||||
/* any other line is said as it is */
|
||||
CASE("command-not")
|
||||
{
|
||||
char name[CHAT_TEXT_SIZE];
|
||||
short minutes = 0;
|
||||
|
||||
CHECK(chat_command_parse("/muted Milenko", name, sizeof(name), &minutes) == _chat_command_none, "/muted");
|
||||
CHECK(chat_command_parse("/mutex", name, sizeof(name), &minutes) == _chat_command_none, "/mutex");
|
||||
CHECK(chat_command_parse("mute Milenko 5", name, sizeof(name), &minutes) == _chat_command_none, "no slash");
|
||||
CHECK(chat_command_parse("hi /mute x", name, sizeof(name), &minutes) == _chat_command_none, "within a line");
|
||||
CHECK(chat_command_parse("/mut", name, sizeof(name), &minutes) == _chat_command_none, "/mut");
|
||||
CHECK(chat_command_parse("", name, sizeof(name), &minutes) == _chat_command_none, "nothing");
|
||||
}
|
||||
|
||||
/* without a player, or for no minutes: how to say it */
|
||||
CASE("command-usage")
|
||||
{
|
||||
char name[CHAT_TEXT_SIZE];
|
||||
short minutes = 0;
|
||||
|
||||
CHECK(chat_command_parse("/mute", name, sizeof(name), &minutes) == _chat_command_usage, "/mute alone");
|
||||
CHECK(chat_command_parse("/unmute", name, sizeof(name), &minutes) == _chat_command_usage, "/unmute alone");
|
||||
CHECK(chat_command_parse("/mute Milenko 0", name, sizeof(name), &minutes) == _chat_command_usage,
|
||||
"a mute of no minutes");
|
||||
CHECK(chat_command_parse("/mute Milenko 000", name, sizeof(name), &minutes) == _chat_command_usage,
|
||||
"a mute of no minutes");
|
||||
}
|
||||
|
||||
/* the whole name in either case first, else the one it begins; none,
|
||||
or more than one */
|
||||
CASE("name-match")
|
||||
{
|
||||
static char const names[6][CHAT_NAME_SIZE] = { "Milenko", "", "Mil", "jonas", "Jonathan", "Bob" };
|
||||
|
||||
CHECK(chat_name_match("Milenko", names, 6) == 0, "the whole name: %d", chat_name_match("Milenko", names, 6));
|
||||
CHECK(chat_name_match("milenko", names, 6) == 0, "in lower case");
|
||||
CHECK(chat_name_match("mil", names, 6) == 2, "the whole name before one it begins: %d",
|
||||
chat_name_match("mil", names, 6));
|
||||
CHECK(chat_name_match("mile", names, 6) == 0, "the one it begins: %d", chat_name_match("mile", names, 6));
|
||||
CHECK(chat_name_match("jon", names, 6) == CHAT_NAME_AMBIGUOUS, "two names begin with it: %d",
|
||||
chat_name_match("jon", names, 6));
|
||||
CHECK(chat_name_match("JONAS", names, 6) == 3, "the whole name over one it begins");
|
||||
CHECK(chat_name_match("Alice", names, 6) == NONE, "no such player");
|
||||
CHECK(chat_name_match("", names, 6) == NONE, "no name");
|
||||
}
|
||||
|
||||
/* a name longer than any player's means none (never read past a name) */
|
||||
CASE("name-bounds")
|
||||
{
|
||||
static char const names[2][CHAT_NAME_SIZE] = { "Bob", "Bobby" };
|
||||
|
||||
CHECK(chat_name_match("Bobbyyyyyyyyyyyyyyyyyy", names, 2) == NONE, "a longer name matched");
|
||||
CHECK(chat_name_match("Bobb", names, 2) == 1, "%d", chat_name_match("Bobb", names, 2));
|
||||
}
|
||||
|
||||
/* a mute's minutes, the one begun counted whole, then none; let go */
|
||||
CASE("mute-time")
|
||||
{
|
||||
struct chat_mute mutes[2];
|
||||
unsigned long now = 1000;
|
||||
|
||||
memset(mutes, 0, sizeof(mutes));
|
||||
CHECK(chat_mute_set(mutes, 2, "Milenko", 5, now), "not muted");
|
||||
CHECK(chat_mute_find(mutes, 2, "Milenko", now) != NULL, "not found");
|
||||
/* (in either case, as the host keeps names apart) */
|
||||
CHECK(chat_mute_find(mutes, 2, "milenko", now) != NULL, "not found in another case");
|
||||
CHECK(chat_mute_find(mutes, 2, "MILENKO", now) != NULL, "not found in capitals");
|
||||
CHECK(chat_mute_find(mutes, 2, "Milenk", now) == NULL, "found by another name");
|
||||
CHECK(chat_mute_find(mutes, 2, "Milenkos", now) == NULL, "found by a longer name");
|
||||
CHECK(chat_mute_minutes_left(&mutes[0], now) == 5, "%d", chat_mute_minutes_left(&mutes[0], now));
|
||||
CHECK(chat_mute_minutes_left(&mutes[0], now + 1) == 5, "%d", chat_mute_minutes_left(&mutes[0], now + 1));
|
||||
CHECK(chat_mute_minutes_left(&mutes[0], now + CHAT_MILLISECONDS_PER_MINUTE) == 4, "%d",
|
||||
chat_mute_minutes_left(&mutes[0], now + CHAT_MILLISECONDS_PER_MINUTE));
|
||||
CHECK(chat_mute_minutes_left(&mutes[0], now + 5 * CHAT_MILLISECONDS_PER_MINUTE - 1) == 1, "the last minute");
|
||||
CHECK(chat_mute_find(mutes, 2, "Milenko", now + 5 * CHAT_MILLISECONDS_PER_MINUTE) == NULL, "still muted");
|
||||
CHECK(!mutes[0].active, "not let go");
|
||||
CHECK(!strcmp(chat_minutes_plural(1), "") && !strcmp(chat_minutes_plural(2), "s"), "plurals");
|
||||
}
|
||||
|
||||
/* the clock wrapping round (system_milliseconds) changes nothing */
|
||||
CASE("mute-wrap")
|
||||
{
|
||||
struct chat_mute mute;
|
||||
unsigned long now = 0xFFFFFFFFUL - 1000;
|
||||
|
||||
memset(&mute, 0, sizeof(mute));
|
||||
chat_mute_set(&mute, 1, "Milenko", 1, now);
|
||||
CHECK(chat_mute_minutes_left(&mute, now + 2000) == 1, "ended across the wrap");
|
||||
CHECK(chat_mute_minutes_left(&mute, now + CHAT_MILLISECONDS_PER_MINUTE) == 0, "not ended across the wrap");
|
||||
}
|
||||
|
||||
/* muting a player again sets their minutes again, in the one mute */
|
||||
CASE("mute-again")
|
||||
{
|
||||
struct chat_mute mutes[3];
|
||||
unsigned long now = 1000;
|
||||
int index;
|
||||
int held = 0;
|
||||
|
||||
memset(mutes, 0, sizeof(mutes));
|
||||
chat_mute_set(mutes, 3, "Milenko", 5, now);
|
||||
chat_mute_set(mutes, 3, "Milenko", 1, now + 1000);
|
||||
for (index = 0; index < 3; index++)
|
||||
held += mutes[index].active;
|
||||
CHECK(held == 1, "%d mutes held for one player", held);
|
||||
CHECK(chat_mute_minutes_left(chat_mute_find(mutes, 3, "Milenko", now + 1000), now + 1000) == 1,
|
||||
"the minutes not set again");
|
||||
}
|
||||
|
||||
/* every mute held: no other player's mute ends early to make room;
|
||||
one run out is taken again */
|
||||
CASE("mute-full")
|
||||
{
|
||||
struct chat_mute mutes[2];
|
||||
unsigned long now = 1000;
|
||||
|
||||
memset(mutes, 0, sizeof(mutes));
|
||||
CHECK(chat_mute_set(mutes, 2, "a", 10, now) && chat_mute_set(mutes, 2, "b", 1, now), "not muted");
|
||||
CHECK(!chat_mute_set(mutes, 2, "c", 5, now), "a third mute taken from two");
|
||||
CHECK(chat_mute_find(mutes, 2, "a", now) && chat_mute_find(mutes, 2, "b", now), "a mute let go early");
|
||||
CHECK(chat_mute_set(mutes, 2, "c", 5, now + CHAT_MILLISECONDS_PER_MINUTE), "the run out mute not taken");
|
||||
CHECK(chat_mute_find(mutes, 2, "a", now + CHAT_MILLISECONDS_PER_MINUTE) &&
|
||||
chat_mute_find(mutes, 2, "c", now + CHAT_MILLISECONDS_PER_MINUTE), "the wrong mute taken");
|
||||
}
|
||||
|
||||
/* links: a scheme, www., a name and a domain (with a path, at the end,
|
||||
before punctuation), an address of four numbers, in either case */
|
||||
CASE("link-found")
|
||||
{
|
||||
static char const *const links[] =
|
||||
{
|
||||
"join https://example.org/x", "ftp://files", "go to WWW.SITE.NET now", "www.halo",
|
||||
"discord.gg/abc", "my clan is at Example.COM", "check yt.tv, it's good", "halo.lol/x!",
|
||||
"ip 192.168.1.20 port 2302", "10.0.0.1",
|
||||
};
|
||||
int index;
|
||||
|
||||
for (index = 0; index < (int)NUMBEROF(links); index++)
|
||||
CHECK(chat_text_has_link(links[index]), "not a link: '%s'", links[index]);
|
||||
}
|
||||
|
||||
/* the dots written out, as a link is dressed to get past a filter */
|
||||
CASE("link-written-out")
|
||||
{
|
||||
static char const *const links[] = { "discord(dot)gg/abc", "example[dot]com", "site(.)net", "evil[.]io",
|
||||
"EXAMPLE(DOT)COM" };
|
||||
int index;
|
||||
|
||||
for (index = 0; index < (int)NUMBEROF(links); index++)
|
||||
CHECK(chat_text_has_link(links[index]), "not a link: '%s'", links[index]);
|
||||
}
|
||||
|
||||
/* the dots written out with spaces about them, or a dot with spaces both
|
||||
sides */
|
||||
CASE("link-spaced")
|
||||
{
|
||||
static char const *const links[] = { "example [dot] com", "discord (dot) gg/abc", "site [.] net",
|
||||
"example . com", "1 . 2 . 3 . 4", "join discord dot gg/x", "EXAMPLE DOT COM", "evil {dot} io" };
|
||||
static char const *const lines[] = { "polka dot me", "the dot is red", "dot dot dot", "the end . then",
|
||||
"wait . . . ok" };
|
||||
int index;
|
||||
|
||||
for (index = 0; index < (int)NUMBEROF(links); index++)
|
||||
CHECK(chat_text_has_link(links[index]), "not a link: '%s'", links[index]);
|
||||
for (index = 0; index < (int)NUMBEROF(lines); index++)
|
||||
CHECK(!chat_text_has_link(lines[index]), "a link: '%s'", lines[index]);
|
||||
}
|
||||
|
||||
/* a domain that is a word as well counts only with a path, a port or
|
||||
another domain after it: "go.to" is a slip of typing */
|
||||
CASE("link-word-domains")
|
||||
{
|
||||
static char const *const links[] = { "youtu.be/abc", "t.co/xyz", "example.co.uk", "halo.me:8080",
|
||||
"clan.us/join" };
|
||||
static char const *const lines[] = { "go.to the base", "he.is camping", "nice shot.Me", "wow.live",
|
||||
"next.fun round", "k.top", "lol.it was close", "me.to", "x.win", "ok.so" };
|
||||
int index;
|
||||
|
||||
for (index = 0; index < (int)NUMBEROF(links); index++)
|
||||
CHECK(chat_text_has_link(links[index]), "not a link: '%s'", links[index]);
|
||||
for (index = 0; index < (int)NUMBEROF(lines); index++)
|
||||
CHECK(!chat_text_has_link(lines[index]), "a link: '%s'", lines[index]);
|
||||
}
|
||||
|
||||
/* what is not one: sentences, numbers, abbreviations, a dot and a word
|
||||
that is not a domain, a domain's letters running into more */
|
||||
CASE("link-not")
|
||||
{
|
||||
static char const *const lines[] =
|
||||
{
|
||||
"gg ez", "nice shot. com on", "the score is 1.5 to 2", "e.g. the sniper", "i.e. no", "U.S.A",
|
||||
"version 1.2.3", "lol...ok", "use the www to read", "wait.comrades", "Mr.Chief", "a.b", "dot com",
|
||||
"hello world", "3.14159", "", "it's .com", "1.2.3.4567", "player.com2", "v1.2.3.4.5",
|
||||
};
|
||||
int index;
|
||||
|
||||
for (index = 0; index < (int)NUMBEROF(lines); index++)
|
||||
CHECK(!chat_text_has_link(lines[index]), "a link: '%s'", lines[index]);
|
||||
}
|
||||
|
||||
/* the host's settings: no chat refuses every line; links refused unless
|
||||
allowed */
|
||||
CASE("refused")
|
||||
{
|
||||
byte on = (byte)FLAG(_chat_config_allowed_bit);
|
||||
byte links = (byte)(FLAG(_chat_config_allowed_bit) | FLAG(_chat_config_links_bit));
|
||||
|
||||
CHECK(chat_refused(0, "hello") != NULL, "a line taken with the chat off");
|
||||
CHECK(chat_refused((byte)FLAG(_chat_config_links_bit), "hello") != NULL, "links alone let the chat on");
|
||||
CHECK(chat_refused(on, "hello") == NULL, "a line refused with the chat on");
|
||||
CHECK(chat_refused(on, "see discord.gg/x") != NULL, "a link taken where links are refused");
|
||||
CHECK(chat_refused(links, "see discord.gg/x") == NULL, "a link refused where links are allowed");
|
||||
}
|
||||
|
||||
/* the on-screen keyboard's characters: a letter in capitals with shift,
|
||||
nothing else changed; none on the last row, or off the keyboard */
|
||||
CASE("keyboard-character")
|
||||
{
|
||||
/* (and a row past them, which no key reads) */
|
||||
static char const *const rows[CHAT_KEYBOARD_ROWS] =
|
||||
{ "1234567890", "qwertyuiop", "asdfghjkl'", "zxcvbnm,.?", "##########" };
|
||||
|
||||
CHECK(chat_keyboard_character(rows, 1, 0, FALSE) == 'q', "'%c'", chat_keyboard_character(rows, 1, 0, FALSE));
|
||||
CHECK(chat_keyboard_character(rows, 1, 0, TRUE) == 'Q', "'%c'", chat_keyboard_character(rows, 1, 0, TRUE));
|
||||
CHECK(chat_keyboard_character(rows, 0, 3, TRUE) == '4', "a digit changed by shift");
|
||||
CHECK(chat_keyboard_character(rows, 3, 9, TRUE) == '?', "a sign changed by shift");
|
||||
CHECK(chat_keyboard_character(rows, CHAT_KEYBOARD_ROWS - 1, 0, FALSE) == 0, "the last row has a character");
|
||||
CHECK(chat_keyboard_character(rows, -1, 0, FALSE) == 0 && chat_keyboard_character(rows, 0, CHAT_KEYBOARD_COLUMNS,
|
||||
FALSE) == 0, "a key off the keyboard");
|
||||
}
|
||||
|
||||
/* moving: round the edges; on the last row a wide key at a time, and its
|
||||
first column */
|
||||
CASE("keyboard-move")
|
||||
{
|
||||
short row = 0;
|
||||
short column = 0;
|
||||
|
||||
chat_keyboard_move(&row, &column, -1, 0);
|
||||
CHECK(row == CHAT_KEYBOARD_ROWS - 1 && column == 0, "up from the top: %d %d", row, column);
|
||||
chat_keyboard_move(&row, &column, 0, -1);
|
||||
CHECK(column == CHAT_KEYBOARD_COLUMNS - CHAT_KEYBOARD_WIDE_COLUMNS, "left round the last row: %d", column);
|
||||
row = 3;
|
||||
column = 5;
|
||||
chat_keyboard_move(&row, &column, 1, 0);
|
||||
CHECK(row == CHAT_KEYBOARD_ROWS - 1 && column == 4, "down onto a wide key: %d %d", row, column);
|
||||
chat_keyboard_move(&row, &column, 0, 1);
|
||||
CHECK(column == 4 + CHAT_KEYBOARD_WIDE_COLUMNS, "right on the last row: %d", column);
|
||||
chat_keyboard_move(&row, &column, 1, 0);
|
||||
CHECK(row == 0 && column == 4 + CHAT_KEYBOARD_WIDE_COLUMNS, "down round the bottom: %d %d", row, column);
|
||||
column = CHAT_KEYBOARD_COLUMNS - 1;
|
||||
chat_keyboard_move(&row, &column, 0, 1);
|
||||
CHECK(column == 0, "right round a row: %d", column);
|
||||
}
|
||||
|
||||
/* a tap: the key under it, a wide key's first column; none outside */
|
||||
CASE("keyboard-tap")
|
||||
{
|
||||
short row = -1;
|
||||
short column = -1;
|
||||
|
||||
CHECK(chat_keyboard_key_at(0.05f, 0.05f, &row, &column) && row == 0 && column == 0, "%d %d", row, column);
|
||||
CHECK(chat_keyboard_key_at(0.95f, 0.3f, &row, &column) && row == 1 && column == 9, "%d %d", row, column);
|
||||
CHECK(chat_keyboard_key_at(0.55f, 0.9f, &row, &column) && row == CHAT_KEYBOARD_ROWS - 1 && column == 4,
|
||||
"the space key: %d %d", row, column);
|
||||
CHECK(!chat_keyboard_key_at(-0.01f, 0.5f, &row, &column) && !chat_keyboard_key_at(0.5f, 1.0f, &row, &column),
|
||||
"a tap outside taken");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ typedef short SHORT;
|
||||
struct platform_input_state { unsigned char keys[TEST_SCANCODE_COUNT], mouse_buttons[8]; BOOL mouse_released, menus; };
|
||||
#define SDL_SCANCODE_COUNT TEST_SCANCODE_COUNT
|
||||
#define console_is_active() FALSE
|
||||
#define network_chat_typing() FALSE
|
||||
#define platform_screen_keyboard(show, password) ((void)0)
|
||||
typedef struct { unsigned short wButtons; BYTE bAnalogButtons[8]; SHORT sThumbLX, sThumbLY; } XINPUT_GAMEPAD;
|
||||
#define SDL_BUTTON_X1 4
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
"""The rules of network_chat.c's text chat: a line's text (another machine's is untrusted), the lines the host takes
|
||||
from a machine, who hears a team's line and a vehicle's, how long a line shows, and the host's /mute: what it
|
||||
reads from a typed line, the player a name means, and how long a mute lasts."""
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
||||
from harness import CHECK_FAILED, build, constant, enum_with, function, mutated, read, run, structure # noqa: E402
|
||||
|
||||
CASES = ["text-printable", "text-control-characters", "text-pipe", "text-bounds", "text-empty", "append", "rate-burst",
|
||||
"rate-refill", "rate-wrap", "hears", "hears-vehicle", "flags", "alpha", "command-mute", "command-unmute",
|
||||
"command-not", "command-usage", "name-match", "name-bounds", "mute-time", "mute-wrap", "mute-again",
|
||||
"mute-full", "link-found", "link-written-out", "link-spaced", "link-word-domains", "link-not", "refused", "keyboard-character",
|
||||
"keyboard-move", "keyboard-tap"]
|
||||
FUNCTIONS = ("chat_text_clean", "chat_text_append", "chat_rate_take", "chat_hears", "chat_channel_from_flags",
|
||||
"chat_channel_flags", "chat_line_alpha", "chat_lower", "chat_command_word", "chat_command_parse",
|
||||
"chat_name_match", "chat_names_equal", "chat_mute_minutes_left", "chat_mute_find", "chat_mute_set", "chat_minutes_plural",
|
||||
"chat_alphanumeric", "chat_link_domain", "chat_text_has_link", "chat_refused", "chat_keyboard_character",
|
||||
"chat_keyboard_move", "chat_keyboard_key_at")
|
||||
|
||||
# a fault in network_chat.c, the function it is in, and the case that must catch it
|
||||
NEGATIVE_CONTROLS = {
|
||||
"control-characters-kept": (("if (character < ' ' || character > '~' || character == '|')",
|
||||
"if (character < 0 || character == '|')"), "chat_text_clean",
|
||||
"text-control-characters"),
|
||||
"pipe-kept": (("if (character < ' ' || character > '~' || character == '|')",
|
||||
"if (character < ' ' || character > '~')"), "chat_text_clean", "text-pipe"),
|
||||
"read-past-size": (("index < source_size && source[index]", "source[index]"), "chat_text_clean", "text-bounds"),
|
||||
"no-length-limit": (("&& length < CHAT_TEXT_SIZE - 1; index++", "; index++"), "chat_text_clean", "text-bounds"),
|
||||
"trailing-spaces-kept": (("while (length > 0 && destination[length - 1] == ' ')", "while (0)"),
|
||||
"chat_text_clean", "text-printable"),
|
||||
"append-unchecked": (("if (*typed >= ' ' && *typed <= '~' && *typed != '|')", "if (*typed && *typed != '|')"),
|
||||
"chat_text_append", "append"),
|
||||
"pipe-typed": (("if (*typed >= ' ' && *typed <= '~' && *typed != '|')", "if (*typed >= ' ' && *typed <= '~')"),
|
||||
"chat_text_append", "text-pipe"),
|
||||
"no-burst-limit": (("if (rate->tokens <= 0)\n\t\treturn FALSE;", ""), "chat_rate_take", "rate-burst"),
|
||||
"refill-unbounded": (("MIN((unsigned long)CHAT_BURST, rate->tokens + gained)", "(rate->tokens + gained)"),
|
||||
"chat_rate_take", "rate-refill"),
|
||||
"team-line-to-all": (("|| sender_team == listener_team", "|| TRUE"), "chat_hears", "hears"),
|
||||
"vehicle-line-to-all": (("return sender_vehicle != NONE && sender_vehicle == listener_vehicle;", "return TRUE;"),
|
||||
"chat_hears", "hears-vehicle"),
|
||||
"vehicle-line-on-foot": (("return sender_vehicle != NONE && sender_vehicle", "return sender_vehicle"),
|
||||
"chat_hears", "hears-vehicle"),
|
||||
"vehicle-flag-dropped": (("if (channel == _chat_channel_vehicle)", "if (0)"), "chat_channel_flags", "flags"),
|
||||
"never-fades": (("if (typing || age < CHAT_LINE_MILLISECONDS)", "if (TRUE)"), "chat_line_alpha", "alpha"),
|
||||
"command-word-prefix": (("if (text[index] && text[index] != ' ')\n\t\treturn NULL;", ""), "chat_command_word",
|
||||
"command-not"),
|
||||
"command-case": (("if (chat_lower(text[index]) != word[index])", "if (text[index] != word[index])"),
|
||||
"chat_command_word", "command-mute"),
|
||||
"minutes-unbounded": (("MIN(typed_minutes * 10 + (rest[index] - '0'), (long)CHAT_MUTE_MAXIMUM_MINUTES)",
|
||||
"typed_minutes * 10 + (rest[index] - '0')"), "chat_command_parse", "command-mute"),
|
||||
"minutes-zero": (("if (typed_minutes == 0)\n\t\t\t\treturn _chat_command_usage;", ""), "chat_command_parse",
|
||||
"command-usage"),
|
||||
"name-unbounded": (("index < length && index < name_size - 1", "index < length"), "chat_command_parse",
|
||||
"command-mute"),
|
||||
"ambiguous-taken": (("if (exact_count > 1 || begins_count > 1)", "if (exact_count > 1 || begins_count > 99)"),
|
||||
"chat_name_match", "name-match"),
|
||||
"exact-not-first": (("if (exact_count == 1)\n\t\treturn exact_index;", "if (0)\n\t\treturn exact_index;"),
|
||||
"chat_name_match", "name-match"),
|
||||
"mute-never-ends": (("if (elapsed >= mute->milliseconds)", "if (0)"), "chat_mute_minutes_left", "mute-time"),
|
||||
"mute-wrap-broken": (("unsigned long elapsed = now - mute->started;",
|
||||
"unsigned long elapsed = now > mute->started ? now - mute->started : 0;"),
|
||||
"chat_mute_minutes_left", "mute-wrap"),
|
||||
"mute-doubled": (("struct chat_mute *mute = chat_mute_find(mutes, count, name, now);",
|
||||
"struct chat_mute *mute = NULL;"), "chat_mute_set", "mute-again"),
|
||||
"mute-overwrites": (("if (!chat_mute_minutes_left(&mutes[index], now))", "if (TRUE)"), "chat_mute_set",
|
||||
"mute-full"),
|
||||
"scheme-missed": (('if (!strncmp(line + index, "://", 3) ||', "if ("), "chat_text_has_link", "link-found"),
|
||||
"address-missed": (("if (part == 4 && !(line[at] == '.' && line[at + 1] >= '0' && line[at + 1] <= '9'))\n"
|
||||
"\t\t\t\treturn TRUE;", ""), "chat_text_has_link", "link-found"),
|
||||
"dots-not-read": (("if (!dots[dot][at])\n\t\t\t\tbreak;", "if (0)\n\t\t\t\tbreak;"), "chat_text_has_link",
|
||||
"link-written-out"),
|
||||
"spaces-about-dot-kept": (("while (length > 0 && line[length - 1] == ' ')\n\t\t\tlength--;", ""),
|
||||
"chat_text_has_link", "link-spaced"),
|
||||
"word-domain-always": (("\t\t\treturn 1;", "\t\t\treturn 2;"), "chat_link_domain", "link-word-domains"),
|
||||
"word-domain-never": (("domain == 2 || (domain == 1 &&", "domain == 2 || (0 &&"), "chat_text_has_link",
|
||||
"link-word-domains"),
|
||||
"mute-case-sensitive": (("for (index = 0; chat_lower(a[index]) == chat_lower(b[index]); index++)",
|
||||
"for (index = 0; a[index] == b[index]; index++)"), "chat_names_equal", "mute-time"),
|
||||
"domain-not-ended": (("if (end - index - 1 < 2 || chat_alphanumeric(line[end]))",
|
||||
"if (end - index - 1 < 2)"), "chat_text_has_link", "link-not"),
|
||||
"links-always-allowed": (("if (!TEST_FLAG(flags, _chat_config_links_bit) && chat_text_has_link(text))", "if (0)"),
|
||||
"chat_refused", "refused"),
|
||||
"chat-always-allowed": (("if (!TEST_FLAG(flags, _chat_config_allowed_bit))", "if (0)"), "chat_refused",
|
||||
"refused"),
|
||||
"shift-not-letters": (("if (shift && character >= 'a' && character <= 'z')", "if (shift)"),
|
||||
"chat_keyboard_character", "keyboard-character"),
|
||||
"last-row-read": (("row >= CHAT_KEYBOARD_ROWS - 1 ||", "row >= CHAT_KEYBOARD_ROWS ||"),
|
||||
"chat_keyboard_character", "keyboard-character"),
|
||||
"move-no-wrap": (("% CHAT_KEYBOARD_ROWS + CHAT_KEYBOARD_ROWS) % CHAT_KEYBOARD_ROWS", "% CHAT_KEYBOARD_ROWS)"),
|
||||
"chat_keyboard_move", "keyboard-move"),
|
||||
"wide-not-snapped": (("*column = (short)(*column - *column % width);", ""), "chat_keyboard_move",
|
||||
"keyboard-move"),
|
||||
"tap-outside-taken": (("if (x < 0.0f || x >= 1.0f || y < 0.0f || y >= 1.0f)", "if (0)"),
|
||||
"chat_keyboard_key_at", "keyboard-tap"),
|
||||
"tap-wide-not-snapped": (("*column = (short)(*column - *column % CHAT_KEYBOARD_WIDE_COLUMNS);", ";"),
|
||||
"chat_keyboard_key_at", "keyboard-tap"),
|
||||
}
|
||||
|
||||
|
||||
def generated(fault=None, faulty_function=None):
|
||||
source = read("port/linux/game/network_chat.c")
|
||||
config = ""
|
||||
for name in ("CHAT_TEXT_SIZE", "CHAT_BURST", "CHAT_REFILL_MILLISECONDS", "CHAT_LINE_MILLISECONDS",
|
||||
"CHAT_FADE_MILLISECONDS", "CHAT_NAME_SIZE", "CHAT_MUTE_DEFAULT_MINUTES", "CHAT_MUTE_MAXIMUM_MINUTES",
|
||||
"CHAT_MILLISECONDS_PER_MINUTE", "CHAT_KEYBOARD_COLUMNS", "CHAT_KEYBOARD_ROWS",
|
||||
"CHAT_KEYBOARD_WIDE_COLUMNS"):
|
||||
config += f"#define {name} {constant(source, name)}\n"
|
||||
config += f"#define CHAT_NAME_AMBIGUOUS ({re.search(r'CHAT_NAME_AMBIGUOUS = (-?[0-9]+)', source).group(1)})\n"
|
||||
config += structure(source, "chat_rate") + "\n"
|
||||
config += structure(source, "chat_mute") + "\n"
|
||||
config += enum_with(source, "_chat_line_team_bit,") + "\n"
|
||||
config += enum_with(source, "_chat_command_none,") + "\n"
|
||||
config += enum_with(source, "_chat_config_allowed_bit,") + "\n"
|
||||
config += enum_with(read("port/linux/game/network_chat.h"), "_chat_channel_everyone,") + "\n"
|
||||
text = ""
|
||||
for name in FUNCTIONS:
|
||||
code = function(source, name)
|
||||
if fault and name == faulty_function:
|
||||
code = mutated(code, *fault)
|
||||
text += code + "\n"
|
||||
return (("config.inc", config), ("under_test.inc", text))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", CASES)
|
||||
def test_case(case):
|
||||
status, output = run(build("chat_logic", generated()), case)
|
||||
assert status == 0, output
|
||||
|
||||
|
||||
@pytest.mark.parametrize("control", NEGATIVE_CONTROLS)
|
||||
def test_negative_control(control):
|
||||
fault, faulty_function, case = NEGATIVE_CONTROLS[control]
|
||||
status, output = run(build("chat_logic", generated(fault, faulty_function)), case)
|
||||
assert status == CHECK_FAILED, f"network_chat.c with a fault ({control}) passed '{case}': the test cannot see it"
|
||||
@@ -0,0 +1,148 @@
|
||||
"""Streamer mode's matcher (port/linux/game/text_filter_match.c), taken whole, with a list of made-up words so that the
|
||||
cases spell nothing offensive: how a word is found however it is dressed (case, accents, look-alikes, leet, repeats,
|
||||
spaces and punctuation, the game's "|" codes), the rules of where it may be, the allowed words and the levels."""
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
||||
from harness import build, mutated, read # noqa: E402
|
||||
|
||||
# the made-up list: (group, severity, rule, word)
|
||||
WORDS = [
|
||||
("_text_filter_slurs", 3, "_text_filter_anywhere", "zorbul"),
|
||||
("_text_filter_slurs", 2, "_text_filter_whole", "blik"),
|
||||
("_text_filter_slurs", 1, "_text_filter_start", "quan"),
|
||||
("_text_filter_swearing", 3, "_text_filter_anywhere", "frak"),
|
||||
("_text_filter_swearing", 1, "_text_filter_whole", "darn"),
|
||||
("_text_filter_swearing", 2, "_text_filter_anywhere", "bebo"),
|
||||
("_text_filter_swearing", 2, "_text_filter_anywhere", "wug"),
|
||||
("_text_filter_insults", 2, "_text_filter_whole", "gorp"),
|
||||
("_text_filter_insults", 1, "_text_filter_anywhere", "trillo"),
|
||||
("_text_filter_insults", 1, "_text_filter_whole", "zarch"),
|
||||
]
|
||||
ALLOWED = ["frakton"]
|
||||
|
||||
ALL = ("1", "1", "1")
|
||||
# (text, levels, what is shown); narrow cases are the game's char strings
|
||||
CASES = {
|
||||
"plain": [("you frak", ALL, "you ****"), ("FRAK off", ALL, "**** off"), ("zorbul", ALL, "******")],
|
||||
"inside-a-name": [("xXzorbulXx", ALL, "xX******Xx"), ("xxfrakxx", ALL, "xx****xx")],
|
||||
"accents": [("fr\u00e4k", ALL, "****"), ("FR\u00c2K", ALL, "****"), ("z\u00f8rbul", ALL, "******")],
|
||||
"look-alikes": [("fr\u0430k", ALL, "****"), ("\u0444rak", ALL, "\u0444rak"),
|
||||
("\uff46\uff52\uff41\uff4b", ALL, "****"),
|
||||
("\u1d00", ALL, "\u1d00"), ("fr\u1d00k", ALL, "****")],
|
||||
"leet": [("fr4k", ALL, "****"), ("fr@k", ALL, "****"), ("phrak", ALL, "*****"), ("z0rbu1", ALL, "******"),
|
||||
("vvug", ALL, "****"), ("|-|", ALL, "|-|")],
|
||||
"repeats": [("frrraaak", ALL, "********"), ("ffrak", ALL, "*****"), ("zorrbuul", ALL, "********")],
|
||||
"doubled-in-the-word": [("trilo", ALL, "trilo"), ("trillo", ALL, "******"), ("trilllllo", ALL, "*********")],
|
||||
"punctuation": [("f.r.a.k", ALL, "*******"), ("f-r-a-k", ALL, "*******"), ("f_r_a_k!", ALL, "*******!")],
|
||||
"spaces": [("f r a k", ALL, "*******"), ("fr ak", ALL, "*****"), ("f r a k", ALL, "**********"),
|
||||
("zor bul", ALL, "*******"), ("mazor bulb", ALL, "mazor bulb"), ("f r\ra k", ALL, "*******")],
|
||||
"too-far-apart": [("f rak", ALL, "f rak")],
|
||||
"wildcards": [("fr*k", ALL, "****"), ("fr?k", ALL, "****"), ("f**k", ALL, "f**k"), ("*rak", ALL, "*rak"),
|
||||
("zo?bu?", ALL, "******"), ("****", ALL, "****")],
|
||||
"digits-alone": [("8380", ALL, "8380"), ("b3b0", ALL, "****")],
|
||||
"hidden-characters": [("fr\u200bak", ALL, "*****"), ("fr\u00adak", ALL, "*****"), ("fra\u0301k", ALL, "*****")],
|
||||
"breaks": [("fr\u4e2dak", ALL, "fr\u4e2dak")],
|
||||
"wide-bar": [("fr|xak", ALL, "******"), ("|nfrak", ALL, "|n****")],
|
||||
"whole": [("blik", ALL, "****"), ("bliks", ALL, "*****"), ("blikes", ALL, "blikes"), ("zarches", ALL, "*******"),
|
||||
("bliker", ALL, "bliker"),
|
||||
("ablik", ALL, "ablik"), ("a blik.", ALL, "a ****."), ("gorp!", ALL, "****!")],
|
||||
"short-words": [("blik", ALL, "****"), ("bliik", ALL, "bliik"), ("bliiik", ALL, "******"),
|
||||
("zarch", ALL, "*****")],
|
||||
"start": [("quanx", ALL, "****x"), ("aquan", ALL, "aquan"), ("quan", ALL, "****")],
|
||||
"allowed": [("frakton", ALL, "frakton"), ("FR4KTON", ALL, "FR4KTON"), ("frak frakton", ALL, "**** frakton")],
|
||||
"levels": [("darn", ("1", "2", "1"), "darn"), ("darn", ("1", "1", "1"), "****"), ("frak", ("1", "0", "1"), "frak"),
|
||||
("frak", ("0", "3", "0"), "****"), ("blik", ("3", "1", "1"), "blik"), ("gorp", ("1", "1", "0"), "gorp")],
|
||||
}
|
||||
NARROW_CASES = {
|
||||
"narrow-style-codes": [("|bfrak", ALL, "|b****"), ("fr|bak", ALL, "******"), ("f|nr|na|nk", ALL, "**********")],
|
||||
"narrow-bar": [("|<", ALL, "|<")],
|
||||
}
|
||||
|
||||
# a fault in text_filter_match.c, and the case that must catch it
|
||||
NEGATIVE_CONTROLS = {
|
||||
"no-punctuation-between": (("if (term_index > 0 && gap < MAXIMUM_GAP &&", "if (0 &&"), "punctuation"),
|
||||
"no-repeats": (("if (repeated != end &&", "if (0 &&"), "repeats"),
|
||||
"short-words-stretched": (("attempt->length > 4 || repeated - end >= 2", "1"), "short-words"),
|
||||
"no-look-alikes": (("*letters = text_filter_fold_letters(code);", "*letters = 0;"), "look-alikes"),
|
||||
"nothing-allowed": (("if (text_filter_allowed(attempt))", "if (0)"), "allowed"),
|
||||
"wildcards-unlimited": (("if (path.wildcards && (", "if (0 && ("), "wildcards"),
|
||||
"digits-alone-enough": (("if (!path.real_letters || path.real_letters * 3 < attempt->length)", "if (0)"),
|
||||
"digits-alone"),
|
||||
"spaces-anywhere": (("if (path.spaced && path.longest_piece > 2 && !(start_boundary && end_boundary))", "if (0)"),
|
||||
"spaces"),
|
||||
"whole-anywhere": (("\tcase _text_filter_whole:\n\t\tif (!start_boundary)",
|
||||
"\tcase _text_filter_whole:\n\t\tif (0)"),
|
||||
"whole"),
|
||||
"levels-ignored": (("term->severity < levels[term->group]", "0"), "levels"),
|
||||
}
|
||||
|
||||
|
||||
def encoded(word):
|
||||
return "".join(f"\\x{ord(character) ^ 0x5A:02X}" for character in word)
|
||||
|
||||
|
||||
def terms_include():
|
||||
lines = ["#define TEXT_FILTER_TERM_KEY 0x5A", "static struct text_filter_term_definition const "
|
||||
"text_filter_term_definitions[] = {"]
|
||||
lines += [f'\t{{ {group}, {severity}, {rule}, "{encoded(word)}" }},' for group, severity, rule, word in WORDS]
|
||||
lines += ["};", "static char const *const text_filter_allowed_words[] = {"]
|
||||
lines += [f'\t"{word}",' for word in ALLOWED]
|
||||
lines += ["};", ""]
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def generated(real=False, fault=None):
|
||||
source = read("port/linux/game/text_filter_match.c")
|
||||
if fault:
|
||||
source = mutated(source, *fault)
|
||||
terms = read("port/linux/game/text_filter_terms.inc") if real else terms_include()
|
||||
return (("text_filter.h", read("port/linux/game/text_filter.h")),
|
||||
("text_filter_terms.inc", terms),
|
||||
("text_filter_fold.inc", read("port/linux/game/text_filter_fold.inc")),
|
||||
("under_test.inc", source))
|
||||
|
||||
|
||||
def censor(executable, texts, levels, narrow=False, extra=()):
|
||||
command = [str(executable), "--censor", *(["--narrow"] if narrow else []), *extra, *levels]
|
||||
data = ("\n".join(texts) + "\n").encode("latin-1" if narrow else "utf-8")
|
||||
result = subprocess.run(command, input=data, capture_output=True, check=True, timeout=60)
|
||||
return result.stdout.decode("latin-1" if narrow else "utf-8").split("\n")[:len(texts)]
|
||||
|
||||
|
||||
def failures(executable, cases, narrow=False):
|
||||
found = []
|
||||
for text, levels, expected in cases:
|
||||
shown = censor(executable, [text], levels, narrow)[0]
|
||||
if shown != expected:
|
||||
found.append(f"{text!r} at {levels}: {shown!r}, not {expected!r}")
|
||||
return found
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(CASES))
|
||||
def test_case(case):
|
||||
assert not failures(build("text_filter", generated()), CASES[case])
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", sorted(NARROW_CASES))
|
||||
def test_narrow_case(case):
|
||||
assert not failures(build("text_filter", generated()), NARROW_CASES[case], narrow=True)
|
||||
|
||||
|
||||
def test_players_words():
|
||||
executable = build("text_filter", generated())
|
||||
assert censor(executable, ["a plonk here", "zorbul"], ("0", "0", "0"), extra=("--add", "plonk")) == \
|
||||
["a ***** here", "zorbul"]
|
||||
assert censor(executable, ["xzorbulite"], ALL, extra=("--allow", "zorbulite")) == ["xzorbulite"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("control", sorted(NEGATIVE_CONTROLS))
|
||||
def test_negative_control(control):
|
||||
fault, case = NEGATIVE_CONTROLS[control]
|
||||
assert failures(build("text_filter", generated(fault=fault)), CASES[case]), \
|
||||
f"{control}: the case {case} does not catch it"
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
Streamer mode's matcher (port/linux/game/text_filter_match.c), taken whole: each line read (UTF-8; or, narrow, bytes as
|
||||
the game's char strings) is written back with the code units it hides as '*'. The levels of SLURS, SWEARING and
|
||||
INSULTS are the arguments (0 off, 1 mild and worse, 2 strong and worse, 3 severe); the player's own words are always
|
||||
hidden. "--add word" and "--allow word" before them add a player's word and an allowed one.
|
||||
*/
|
||||
|
||||
#include "harness.h"
|
||||
#include "under_test.inc"
|
||||
|
||||
static long utf8_to_units(char const *text, unsigned short *units, long maximum)
|
||||
{
|
||||
long count = 0;
|
||||
unsigned char const *byte = (unsigned char const *)text;
|
||||
|
||||
while (*byte && count < maximum)
|
||||
{
|
||||
unsigned long code = *byte++;
|
||||
|
||||
if (code >= 0xE0 && byte[0] && byte[1])
|
||||
{
|
||||
code = ((code & 0x0F) << 12) | ((byte[0] & 0x3F) << 6) | (byte[1] & 0x3F);
|
||||
byte += 2;
|
||||
}
|
||||
else if (code >= 0xC0 && byte[0])
|
||||
{
|
||||
code = ((code & 0x1F) << 6) | (byte[0] & 0x3F);
|
||||
byte += 1;
|
||||
}
|
||||
units[count++] = (unsigned short)code;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static void put_unit(unsigned short code)
|
||||
{
|
||||
if (code < 0x80)
|
||||
{
|
||||
putchar(code);
|
||||
}
|
||||
else if (code < 0x800)
|
||||
{
|
||||
putchar(0xC0 | (code >> 6));
|
||||
putchar(0x80 | (code & 0x3F));
|
||||
}
|
||||
else
|
||||
{
|
||||
putchar(0xE0 | (code >> 12));
|
||||
putchar(0x80 | ((code >> 6) & 0x3F));
|
||||
putchar(0x80 | (code & 0x3F));
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static char line[8192];
|
||||
static unsigned short units[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
static unsigned char censored[TEXT_FILTER_MAXIMUM_LENGTH];
|
||||
unsigned char levels[NUMBER_OF_TEXT_FILTER_GROUPS] = { 1, 1, 1, 1 };
|
||||
int narrow = 0;
|
||||
int argument = 1;
|
||||
int level = 0;
|
||||
|
||||
if (argc < 2 || strcmp(argv[1], "--censor"))
|
||||
{
|
||||
fprintf(stderr, "usage: text_filter --censor [--narrow] [--add word] [--allow word] slurs swearing insults\n");
|
||||
return 2;
|
||||
}
|
||||
text_filter_words_reset();
|
||||
for (argument = 2; argument < argc; argument++)
|
||||
{
|
||||
if (!strcmp(argv[argument], "--narrow"))
|
||||
narrow = 1;
|
||||
else if (!strcmp(argv[argument], "--add") && argument + 1 < argc)
|
||||
CHECK(text_filter_word_add(argv[++argument], _text_filter_own, _text_filter_severe, _text_filter_anywhere), "add");
|
||||
else if (!strcmp(argv[argument], "--allow") && argument + 1 < argc)
|
||||
CHECK(text_filter_allow_add(argv[++argument]), "allow");
|
||||
else if (level < 3)
|
||||
levels[level++] = (unsigned char)atoi(argv[argument]);
|
||||
}
|
||||
while (fgets(line, sizeof(line), stdin))
|
||||
{
|
||||
long length;
|
||||
long index;
|
||||
|
||||
line[strcspn(line, "\n")] = 0;
|
||||
if (narrow)
|
||||
{
|
||||
for (length = 0; line[length] && length < TEXT_FILTER_MAXIMUM_LENGTH; length++)
|
||||
units[length] = (unsigned char)line[length];
|
||||
}
|
||||
else
|
||||
{
|
||||
length = utf8_to_units(line, units, TEXT_FILTER_MAXIMUM_LENGTH);
|
||||
}
|
||||
text_filter_censor(units, length, narrow, levels, censored);
|
||||
for (index = 0; index < length; index++)
|
||||
put_unit(censored[index] ? '*' : units[index]);
|
||||
putchar('\n');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -13,6 +13,8 @@ settings defaults" shows the defaults. Controls Setup binds the keyboard and
|
||||
mouse's controls, by the functions the PC version names for it.
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from xml.sax.saxutils import quoteattr
|
||||
|
||||
@@ -251,6 +253,9 @@ SCREENS["audio_settings/sound_processing"] = {
|
||||
],
|
||||
}
|
||||
_audio["rows"] = [row for row in _audio["rows"] if row[1] not in _processing]
|
||||
|
||||
# (voice chat stays on Audio Setup; the text chat's rows are the multiplayer
|
||||
# HUD's, on Network Setup)
|
||||
_audio["categories"] = [
|
||||
("SOUND PROCESSING:", "audio_settings/sound_processing",
|
||||
"The reverb, and how sounds are converted to the\noutput's rate."),
|
||||
@@ -258,12 +263,22 @@ _audio["categories"] = [
|
||||
|
||||
# Network Setup's map sharing (port/linux/game/map_share.c): this machine's
|
||||
# part in another's game, a screen of its own (a category, as Video Setup's)
|
||||
SEED_UPLOADS = (64, 128, 256, 512, 1024, 2048)
|
||||
SEED_UPLOADS = (64, 128, 256, 512, 1024, 2048, 4096, 8192, 10240)
|
||||
_network = SCREENS["network_setup"]
|
||||
# (and the multiplayer HUD's rows, and streamer mode, screens of their own:
|
||||
# Network Setup has room for nine places)
|
||||
_hud_settings = ("display.player_names", "display.player_name_scale", "display.scoreboard_team_layout",
|
||||
"display.scoreboard_background")
|
||||
_hud_rows = [row for row in _network["rows"] if row[1] in _hud_settings]
|
||||
_network["rows"] = [row for row in _network["rows"] if row[1] not in _hud_settings]
|
||||
_network["categories"] = [
|
||||
("MAP SHARING:", "network_setup/map_sharing",
|
||||
"Downloading Custom Edition maps you do not have,\nand helping send them to other players.",
|
||||
"desktop android"),
|
||||
("MULTIPLAYER HUD:", "network_setup/multiplayer_hud",
|
||||
"Players' names above their heads, the\nscoreboard, and the text chat."),
|
||||
("STREAMER MODE:", "network_setup/streamer_mode",
|
||||
"Hide offensive words in names and text from\nother players, maps and mods, as stars."),
|
||||
]
|
||||
SCREENS["network_setup/map_sharing"] = {
|
||||
"screen": "map_sharing_settings_screen", "header": _network["header"], "spacing": 30,
|
||||
@@ -279,13 +294,53 @@ SCREENS["network_setup/map_sharing"] = {
|
||||
],
|
||||
}
|
||||
|
||||
# Network Setup's multiplayer HUD: its rows, moved from Network Setup, and the
|
||||
# text chat's (port/linux/game/network_chat.c)
|
||||
SCREENS["network_setup/multiplayer_hud"] = {
|
||||
"screen": "multiplayer_hud_settings_screen", "header": _network["header"], "spacing": 30,
|
||||
"rows": _hud_rows + [
|
||||
("TEXT CHAT:", "display.text_chat", [("SHOW", "true"), ("HIDE", "false")],
|
||||
"SHOW the text chat, or HIDE it: no lines, and\nits keys and D-pad Up open nothing.", None),
|
||||
("CHAT TEXT:", "display.chat_style", [("COLORS", "colors"), ("WHITE", "white")],
|
||||
"The text chat's colors: COLORS, names in their\nteam's color; WHITE, as Custom Edition.", None),
|
||||
],
|
||||
}
|
||||
|
||||
# Network Setup's streamer mode (port/linux/game/text_filter.c): words hidden
|
||||
# in what other players, maps and mods show, each group from a severity of
|
||||
# Surge AI's on (port/assets/text_filter)
|
||||
STREAMER_LEVELS = [("OFF", "off"), ("SEVERE", "severe"), ("STRONG AND WORSE", "strong"), ("MILD AND WORSE", "mild")]
|
||||
SCREENS["network_setup/streamer_mode"] = {
|
||||
"screen": "streamer_mode_settings_screen", "header": _network["header"], "spacing": 30,
|
||||
"rows": [
|
||||
("STREAMER MODE:", "streamer.enabled", ON_OFF,
|
||||
"Hide offensive words in names and text from\nother players, maps and mods, as stars.", None),
|
||||
("CENSOR SLURS:", "streamer.slurs", STREAMER_LEVELS,
|
||||
"Slurs about race, sexuality, gender and\ndisability.", None),
|
||||
("CENSOR SWEARING:", "streamer.swearing", STREAMER_LEVELS,
|
||||
"Swearing and sexual words (STRONG AND WORSE\nleaves the mildest showing).", None),
|
||||
("CENSOR INSULTS:", "streamer.insults", STREAMER_LEVELS,
|
||||
"Name-calling and insults that are not slurs.", None),
|
||||
],
|
||||
}
|
||||
|
||||
# Network Setup in a game (the pause menu's SETTINGS: port/linux/game/
|
||||
# menu_tags.c's pause_network_patch): its pages alone, without the rows that
|
||||
# would drop the game (internet play) or are for the main menu (the router,
|
||||
# the clipboard, the updates)
|
||||
SCREENS["network_setup/in_game"] = {
|
||||
"screen": "in_game_network_settings_screen", "header": _network["header"], "spacing": 30,
|
||||
"platform_places": True, "rows": [], "categories": _network["categories"],
|
||||
}
|
||||
|
||||
# Controls Setup: the keyboard and mouse's actions, in groups (the order of
|
||||
# port/linux/game/menu_functions.c's table of them)
|
||||
CONTROL_GROUPS = ["MOVEMENT", "WEAPONS", "ACTIONS"]
|
||||
CONTROL_GROUPS = ["MOVEMENT", "WEAPONS", "ACTIONS", "COMMUNICATION"]
|
||||
CONTROL_ROWS = 7
|
||||
|
||||
# the settings whose rows have the wider spinner (a device's name)
|
||||
WIDE_SETTINGS = {"audio.output_device", "audio.input_device"}
|
||||
WIDE_SETTINGS = {"audio.output_device", "audio.input_device", "streamer.slurs", "streamer.swearing",
|
||||
"streamer.insults"}
|
||||
|
||||
# the host's voice chat and vote kicks, on Teamplay Options
|
||||
# (_teamplay_options_extras): each row's key, its label, its choices' words
|
||||
@@ -314,6 +369,13 @@ TEAMPLAY_ROWS = [
|
||||
"Players can vote to kick a player, from the\\nscoreboard.",
|
||||
"Players cannot vote to kick anyone.",
|
||||
]),
|
||||
# (network_chat.c: one row for the chat and its links, as Teamplay
|
||||
# Options has room for one more)
|
||||
("text_chat", "TEXT CHAT:", ["ON", "WITH LINKS", "OFF"], [
|
||||
"Players can type to each other; lines with links\\nare refused. Off in a public internet game.",
|
||||
"Players can type to each other, links too. Off\\nin a public internet game.",
|
||||
"No text chat in the game.",
|
||||
]),
|
||||
]
|
||||
|
||||
# the profile menu's words for what its items now open
|
||||
@@ -1122,12 +1184,13 @@ COOP_SETUP_SCREENS = [
|
||||
"Players walk through each other, so that no one\\nblocks a doorway. The AI's characters still block.",
|
||||
]),
|
||||
]),
|
||||
("voice_options", "VOICE AND VOTING", "Voice chat and votes to kick a player, for this\\ngame.", TEAMPLAY_ROWS),
|
||||
("voice_options", "VOICE AND VOTING", "Voice chat, text chat and votes to kick a player,\\nfor this game.",
|
||||
TEAMPLAY_ROWS),
|
||||
]
|
||||
# Server Setup's map sharing (port/linux/game/map_share.c), for any game,
|
||||
# laid out as co-op's options are (its key, its title, its row's help and
|
||||
# its rows: menu_functions.c's gametype_options give their settings' values)
|
||||
MAP_SHARE_UPLOADS = (256, 512, 1024, 2048, 4096, 8192)
|
||||
MAP_SHARE_UPLOADS = (256, 512, 1024, 2048, 4096, 8192, 16384, 20480)
|
||||
MAP_SHARE_SETUP = ("map_share_options", "MAP SHARING",
|
||||
"Sending players who join without the game's\\nCustom Edition map the map, and how fast.", [
|
||||
("map_share", "SHARE MAPS:", ["ON", "OFF"], [
|
||||
@@ -1538,11 +1601,15 @@ REPLACED_FOLDERS = [f"{MT}/server_settings"]
|
||||
# each turned on or off and moved up or down (menu_functions.c's "port mods"
|
||||
# functions)
|
||||
|
||||
# the redraws' main menu items (svg/shell/main_menu/menu_*.svg): their text's
|
||||
# capitals' top and height, its colour dim (not chosen) and its glow chosen,
|
||||
# and where its middle is
|
||||
MENU_ITEM_TOP, MENU_ITEM_CAP, MENU_ITEM_MIDDLE = 6.57, 21.5 * 0.9037, 130.0
|
||||
TITLE_FONT_PATH = Path(__file__).resolve().parent.parent / "port/assets/fonts/OpenCE-Regular.ttf"
|
||||
# the redraws' main menu items (svg/shell/main_menu/menu_*.svg): their
|
||||
# letters' top and scale, and where their middle is
|
||||
MENU_ITEM_TOP, MENU_ITEM_SCALE, MENU_ITEM_MIDDLE = 6.57, 0.9037, 130.0
|
||||
# the space between two of the redraws' letters, in their units (their
|
||||
# capitals are 21.5 high), for the pairs the port's items have: no redraw has
|
||||
# these pairs, so each is the sum of a space after the first letter and one
|
||||
# before the second, fitted (least squares) to the 53 pairs the redraws' items
|
||||
# and headers have (D-I, of the main menu's Credits, gives D's right side)
|
||||
MENU_ITEM_SPACES = {"MO": 3.17, "OD": 2.8, "DS": 2.3}
|
||||
# the mods' status icons (port/assets/icons/lucide): a mod out of the order it
|
||||
# asks for, and one that cannot be played (another mod says it cannot be
|
||||
# played with it, or this build cannot play it): menu_functions.c's
|
||||
@@ -1550,50 +1617,49 @@ TITLE_FONT_PATH = Path(__file__).resolve().parent.parent / "port/assets/fonts/Op
|
||||
MOD_STATUS_ICONS = [("triangle-alert", "#FFB020"), ("circle-x", "#FF4040")]
|
||||
|
||||
|
||||
def menu_item_frames(text: str) -> list:
|
||||
"""the frames (svg, width, height) of a main menu item of the port's:
|
||||
its text set in OpenCE (Newtown respaced: port/assets/fonts) as the
|
||||
redraws' items are, dim, then white with their blue glow"""
|
||||
from fontTools.pens.boundsPen import BoundsPen
|
||||
from fontTools.pens.svgPathPen import SVGPathPen
|
||||
from fontTools.pens.transformPen import TransformPen
|
||||
from fontTools.ttLib import TTFont
|
||||
def redraw_letters(redraws: Path) -> dict:
|
||||
"""the redraws' letters (their <path id="gA">s, one drawing of each
|
||||
letter in every item and header), by letter"""
|
||||
letters = {}
|
||||
for svg in sorted(redraws.rglob("*.svg")):
|
||||
if any(part.startswith("_") for part in svg.relative_to(redraws).parts):
|
||||
continue
|
||||
for letter, path in re.findall(r'<path id="g([A-Z])" d="([^"]+)"', svg.read_text()):
|
||||
if letters.setdefault(letter, path) != path:
|
||||
sys.exit(f"{svg}: the redraws draw {letter} two ways")
|
||||
return letters
|
||||
|
||||
font = TTFont(str(TITLE_FONT_PATH))
|
||||
glyphs = font.getGlyphSet()
|
||||
cmap = font.getBestCmap()
|
||||
kerning = font["kern"].kernTables[0].kernTable if "kern" in font else {}
|
||||
cap = glyphs["H"]
|
||||
pen = BoundsPen(glyphs)
|
||||
cap.draw(pen)
|
||||
scale = MENU_ITEM_CAP / (pen.bounds[3] - pen.bounds[1])
|
||||
names = [cmap[ord(character)] for character in text]
|
||||
widths = [font["hmtx"][name][0] for name in names]
|
||||
advance = sum(widths) + sum(kerning.get((first, second), 0) for first, second in zip(names, names[1:]))
|
||||
x = MENU_ITEM_MIDDLE / scale - advance / 2
|
||||
baseline = MENU_ITEM_TOP + MENU_ITEM_CAP
|
||||
defs, uses = {}, []
|
||||
for index, name in enumerate(names):
|
||||
if name not in defs and name != "space":
|
||||
path = SVGPathPen(glyphs, lambda value: f"{value:.2f}".rstrip("0").rstrip("."))
|
||||
glyphs[name].draw(TransformPen(path, (1, 0, 0, -1, 0, 0)))
|
||||
defs[name] = path.getCommands()
|
||||
if name != "space":
|
||||
uses.append(f'<use href="#g{name}" transform="translate({x * scale:.2f},{baseline:.2f}) scale({scale:.5f})"/>')
|
||||
x += widths[index] + (kerning.get((name, names[index + 1]), 0) if index + 1 < len(names) else 0)
|
||||
paths = [f' <path id="g{name}" d="{commands}"/>' for name, commands in sorted(defs.items())]
|
||||
head = ['<svg xmlns="http://www.w3.org/2000/svg" width="256" height="64" viewBox="0 0 256 64">', " <defs>", *paths]
|
||||
# (as heavy as the redraws' letters: a thin edge of their colour)
|
||||
edge = f'stroke-width="{0.9 / scale:.2f}" stroke-linejoin="round"'
|
||||
|
||||
def menu_item_frames(text: str, redraws: Path) -> list:
|
||||
"""the frames (svg, width, height) of a main menu item of the port's: its
|
||||
text in the redraws' own letters (redraw_letters), spaced, placed and
|
||||
coloured as their items are, dim, then white with their blue glow"""
|
||||
from fontTools.pens.boundsPen import BoundsPen
|
||||
from fontTools.svgLib.path import parse_path
|
||||
|
||||
letters = redraw_letters(redraws)
|
||||
widths = []
|
||||
for letter in text:
|
||||
pen = BoundsPen(None)
|
||||
parse_path(letters[letter], pen)
|
||||
widths.append(pen.bounds[2])
|
||||
spaces = [MENU_ITEM_SPACES[first + second] for first, second in zip(text, text[1:])]
|
||||
x = MENU_ITEM_MIDDLE - (sum(widths) + sum(spaces)) * MENU_ITEM_SCALE / 2
|
||||
uses = []
|
||||
for index, letter in enumerate(text):
|
||||
uses.append(f'<use href="#g{letter}" transform="translate({x:.2f},{MENU_ITEM_TOP}) scale({MENU_ITEM_SCALE})"/>')
|
||||
x += (widths[index] + (spaces[index] if index < len(spaces) else 0)) * MENU_ITEM_SCALE
|
||||
paths = [f' <path id="g{letter}" d="{letters[letter]}"/>' for letter in sorted(set(text))]
|
||||
head = ['<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" '
|
||||
'height="64" viewBox="0 0 256 64">', " <defs>", *paths]
|
||||
dim = [*head, " </defs>", f' <!-- "{text}" (normal state: dim blue) -->',
|
||||
f' <g id="text" fill="#2895ff" stroke="#2895ff" opacity="0.467" {edge}>',
|
||||
*[f" {use}" for use in uses], " </g>", "</svg>", ""]
|
||||
' <g id="text" fill="#2895ff" fill-opacity="0.467">', *[f" {use}" for use in uses], " </g>", "</svg>", ""]
|
||||
glow = [*head, ' <filter id="glow" filterUnits="userSpaceOnUse" x="0" y="0" width="256" height="64">',
|
||||
' <feGaussianBlur stdDeviation="2.19"/>', " </filter>", " </defs>",
|
||||
f' <!-- "{text}" (highlighted: white with blue glow) -->',
|
||||
f' <g fill="#2895ff" stroke="#2895ff" stroke-width="{6.3 / scale:.2f}" stroke-linejoin="round" '
|
||||
'opacity="0.650" filter="url(#glow)">', *[f" {use}" for use in uses], " </g>",
|
||||
f' <g id="text" fill="#fff" stroke="#fff" {edge}>', *[f" {use}" for use in uses], " </g>", "</svg>", ""]
|
||||
' <g fill="#2895ff" stroke="#2895ff" stroke-width="6.3" stroke-linejoin="round" opacity="0.650" '
|
||||
'filter="url(#glow)">', *[f" {use}" for use in uses], " </g>",
|
||||
' <g id="text" fill="#fff">', *[f" {use}" for use in uses], " </g>", "</svg>", ""]
|
||||
return [("\n".join(dim), 256, 64), ("\n".join(glow), 256, 64)]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
"""Streamer mode's words (port/linux/game/text_filter_terms.inc, tools/text_filter_terms.py): the table agrees with the
|
||||
review (port/assets/text_filter/review.txt) and the allowed words, hides in the English word list just the words
|
||||
expected (english.txt), and hides nothing of the game's own text but its two lines of swearing: the menus' (asset-free,
|
||||
at the widest levels) and the maps' string lists and HUD messages (assets/maps, else skipped; at the default levels).
|
||||
With HALO_SURGE_CSV naming Surge AI's profanity_en.csv, the table is made again from it and must be the one committed.
|
||||
|
||||
The words are ROT13'd here and in the files, as in review.txt; a failure prints them so."""
|
||||
|
||||
import codecs
|
||||
import gzip
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(ROOT / "tools"))
|
||||
sys.path.insert(0, str(ROOT / "tools" / "harness" / "tests"))
|
||||
import text_filter_terms # noqa: E402
|
||||
from harness import build # noqa: E402
|
||||
from test_text_filter import censor, generated # noqa: E402
|
||||
|
||||
ASSETS = ROOT / "port" / "assets" / "text_filter"
|
||||
MAPS = ROOT / "assets" / "maps"
|
||||
ALL = ("1", "1", "1")
|
||||
# the settings' defaults (port_config.c): slurs mild and worse, swearing strong and worse, insults off
|
||||
DEFAULTS = ("1", "2", "0")
|
||||
|
||||
|
||||
def rot13(text):
|
||||
return codecs.encode(text, "rot13")
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def matcher():
|
||||
return build("text_filter", generated(real=True))
|
||||
|
||||
|
||||
def hidden(matcher, texts, levels):
|
||||
"""the texts something is hidden in"""
|
||||
texts = [text.replace("\n", " ").replace("\r", " ") for text in texts]
|
||||
return {text for text, shown in zip(texts, censor(matcher, texts, levels)) if shown != text}
|
||||
|
||||
|
||||
def test_table_agrees_with_the_review():
|
||||
review = text_filter_terms.read_review(ASSETS / "review.txt")
|
||||
terms = text_filter_terms.read_terms()
|
||||
keys = {key for _, _, _, key in terms}
|
||||
allowed = re.findall(r'^\t"([a-z]+)",$', text_filter_terms.TERMS_INC.read_text(), re.M)
|
||||
assert allowed == sorted(set(text_filter_terms.read_allowed(ASSETS / "allow.txt")))
|
||||
dropped = {text_filter_terms.letters(word) for word in review["drop"]} - {None}
|
||||
assert not keys & dropped, f"dropped words in the table: {sorted(rot13(key) for key in keys & dropped)}"
|
||||
anywhere = [(group, severity, key) for group, severity, rule, key in terms if rule == "anywhere"]
|
||||
for word, (group, severity, rule) in review["keep"].items():
|
||||
key = text_filter_terms.letters(word)
|
||||
assert key in keys or any(other in key for _, _, other in anywhere), \
|
||||
f"a kept word is not in the table: {rot13(word)}"
|
||||
for word in review["term"]:
|
||||
assert text_filter_terms.letters(word) in keys, f"a review term is not in the table: {rot13(word)}"
|
||||
recorded = re.search(r"sha256 ([0-9a-f]{64})", text_filter_terms.TERMS_INC.read_text()).group(1)
|
||||
assert recorded in (ASSETS / "README.md").read_text(), "the README names another version of the list"
|
||||
|
||||
|
||||
@pytest.mark.skipif(not os.environ.get("HALO_SURGE_CSV"), reason="HALO_SURGE_CSV (Surge AI's profanity_en.csv) unset")
|
||||
def test_table_made_again():
|
||||
csv_path = os.environ["HALO_SURGE_CSV"]
|
||||
assert hashlib.sha256(Path(csv_path).read_bytes()).hexdigest() in text_filter_terms.TERMS_INC.read_text()
|
||||
english = text_filter_terms.English(text_filter_terms.ENGLISH)
|
||||
terms, unreviewed, _ = text_filter_terms.build(csv_path, text_filter_terms.read_review(ASSETS / "review.txt"),
|
||||
english)
|
||||
assert not unreviewed
|
||||
assert terms == text_filter_terms.read_terms()
|
||||
|
||||
|
||||
def test_english_words_hidden(matcher):
|
||||
with gzip.open(text_filter_terms.ENGLISH, "rt") as file:
|
||||
words = file.read().split()
|
||||
found = hidden(matcher, words, ALL)
|
||||
expected = {rot13(line) for line in (ASSETS / "english.txt").read_text().split()}
|
||||
assert found == expected, (f"hidden, not expected: {sorted(rot13(word) for word in found - expected)}; "
|
||||
f"expected, not hidden: {sorted(rot13(word) for word in expected - found)} "
|
||||
"(ROT13'd: if right, port/assets/text_filter/english.txt)")
|
||||
|
||||
|
||||
def menu_texts():
|
||||
texts = []
|
||||
for path in sorted((ROOT / "port" / "assets" / "menus").rglob("*.xml")):
|
||||
for value in re.findall(r'\b(?:text|strings)="([^"]*)"', path.read_text(encoding="utf-8")):
|
||||
texts += [part.replace("\\n", " ") for part in value.split("|")]
|
||||
return [text for text in texts if text.strip()]
|
||||
|
||||
|
||||
# the game's own text that has swearing in it (ROT13'd: a multiplayer profile name, and a tip of the loading
|
||||
# screens the PC version's menus have too), hidden as other players' would be
|
||||
PROFILE_NAME = rot13("Cevfba Ovgpu")
|
||||
TIP = rot13("Lbh unir bar yvsr gb yvir. Ohg ng yrnfg lbh'er hfvat vg gb xvpx nff npebff gur tnynkl vafgrnq bs whfg "
|
||||
"fvggvat va n znafvba pelvat jvgu lbhe evpu fbpvnyvgr ybiref.")
|
||||
|
||||
|
||||
def test_menus_hide_nothing(matcher):
|
||||
texts = menu_texts()
|
||||
assert len(texts) > 500
|
||||
found = hidden(matcher, texts, ALL)
|
||||
assert found == {TIP}, f"the menus' own text hidden: {sorted(rot13(text) for text in found)}"
|
||||
|
||||
|
||||
def map_texts(path):
|
||||
from test_mods import TAG_BASE, MapTags
|
||||
tags = MapTags(path)
|
||||
texts = []
|
||||
for group, _, definition in tags.instances.values():
|
||||
if group == b"ustr":
|
||||
references = [data for _, data in tags.block(definition, 0, 20)]
|
||||
elif group == b"hmt ":
|
||||
references = [tags.tags[definition - TAG_BASE:][:20]]
|
||||
else:
|
||||
continue
|
||||
for reference in references:
|
||||
size, _, _, address, _ = struct.unpack("<iiiII", reference)
|
||||
if size > 0:
|
||||
text = tags.tags[address - TAG_BASE:address - TAG_BASE + size].decode("utf-16-le", "replace")
|
||||
texts += [part for part in text.split("\0") if part.strip()]
|
||||
return texts
|
||||
|
||||
|
||||
@pytest.mark.skipif(not MAPS.is_dir() or not any(MAPS.glob("*.map")), reason="no maps (assets/maps)")
|
||||
def test_maps_hide_nothing_by_default(matcher):
|
||||
texts = []
|
||||
for path in sorted(MAPS.glob("*.map")):
|
||||
try:
|
||||
texts += map_texts(path)
|
||||
except Exception: # (a map this reader cannot read: a Custom Edition one)
|
||||
continue
|
||||
assert len(texts) > 1000
|
||||
found = {" ".join(text.split()) for text in hidden(matcher, sorted(set(texts)), DEFAULTS)}
|
||||
assert found == {PROFILE_NAME, TIP}, f"the maps' own text hidden: {sorted(rot13(text) for text in found)}"
|
||||
|
||||
|
||||
def test_check_command():
|
||||
result = subprocess.run([sys.executable, str(ROOT / "tools" / "text_filter_terms.py"), "--check",
|
||||
rot13("shpx guvf"), "Scunthorpe"], capture_output=True, text=True, check=True)
|
||||
assert "-> '**** this'" in result.stdout and "-> 'Scunthorpe'" in result.stdout
|
||||
@@ -126,7 +126,7 @@ def test_the_site_holds_the_page_its_fonts_licences_and_version():
|
||||
phony = re.search(r"^build web: phony ([^\n]*)", text, re.M).group(1)
|
||||
outputs = set(phony.split())
|
||||
for name in ("halo.js", "halo.wasm", "version.json", "licenses.txt", "fonts/OpenCE-Regular.ttf",
|
||||
"fonts/Overpass-750.ttf"):
|
||||
"fonts/Overpass-750.ttf", "fonts/Overpass-900.ttf"):
|
||||
assert f"build/web/site/{name}" in outputs, name
|
||||
for source in web_build.site_sources():
|
||||
assert f"build/web/site/{source.relative_to(Path('port/web/site')).as_posix()}" in outputs, source
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Streamer mode's words (port/linux/game/text_filter_match.c): writes
|
||||
port/linux/game/text_filter_terms.inc from Surge AI's rated list of
|
||||
profanities and this project's review of it, and lists or tries them.
|
||||
|
||||
python3 tools/text_filter_terms.py --surge .../profanity_en.csv
|
||||
python3 tools/text_filter_terms.py --list [slurs|swearing|insults]
|
||||
python3 tools/text_filter_terms.py --check "some text"
|
||||
python3 tools/text_filter_terms.py --fold
|
||||
|
||||
The list (port/assets/text_filter/README.md): Surge AI's profanity_en.csv
|
||||
(MIT), each row a spelling with up to three base words, three categories
|
||||
and a severity (Mild, Strong, Severe). A base word's group is its own row's
|
||||
first category's (failing that, the first category most of its spellings
|
||||
give): SLURS, SWEARING or INSULTS (GROUPS). Its severity is the worst of the
|
||||
rows that name it alone (failing that, of all its rows). Its spellings are
|
||||
the rows that name it alone, kept to their letters; those with digits or
|
||||
symbols are left to the matcher's leet, and those another term already
|
||||
finds are left out.
|
||||
|
||||
port/assets/text_filter/review.txt is the review of every base word, the
|
||||
words ROT13'd (nothing in the repository spells them out):
|
||||
|
||||
keep <group|-> <severity|-> <rule|-> <word> a base word kept: its group
|
||||
(- Surge's first category's),
|
||||
its severity (- Surge's),
|
||||
its rule (- worked out)
|
||||
drop <word> a base word or spelling left out
|
||||
term <group> <severity> <rule|-> <word> a word of the project's, or
|
||||
a spelling's own settings
|
||||
|
||||
A rule (where a term may be found: text_filter.h) worked out is "anywhere"
|
||||
when no English word (tools/../port/third_party/english-words) has it but
|
||||
its own forms (s, es, ed, er, ing, y), "start" when none starts with it but
|
||||
those, and "whole" otherwise. port/assets/text_filter/allow.txt is the words
|
||||
never hidden (Scunthorpe), in plain text.
|
||||
|
||||
A base word of the CSV that the review does not name stops the generator,
|
||||
which then prints a line to review for each (--template prints them all).
|
||||
The CSV is not in the repository: the .inc records its checksum, and
|
||||
tools/test_text_filter_terms.py checks the .inc against the review without
|
||||
it. --fold writes text_filter_fold.inc, the characters above ASCII that read
|
||||
as letters, from Python's Unicode names (its version is recorded).
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import codecs
|
||||
import csv
|
||||
import gzip
|
||||
import hashlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import unicodedata
|
||||
from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
ASSETS = ROOT / "port/assets/text_filter"
|
||||
REVIEW = ASSETS / "review.txt"
|
||||
ALLOW = ASSETS / "allow.txt"
|
||||
TERMS_INC = ROOT / "port/linux/game/text_filter_terms.inc"
|
||||
FOLD_INC = ROOT / "port/linux/game/text_filter_fold.inc"
|
||||
ENGLISH = ROOT / "port/third_party/english-words/words_alpha.txt.gz"
|
||||
KEY = 0x5A
|
||||
|
||||
GROUPS = {
|
||||
"racial / ethnic slurs": "slurs", "sexual orientation / gender": "slurs", "mental disability": "slurs",
|
||||
"physical disability": "slurs", "political": "slurs",
|
||||
"sexual anatomy / sexual acts": "swearing", "bodily fluids / excrement": "swearing",
|
||||
"religious offense": "swearing",
|
||||
"other / general insult": "insults", "animal references": "insults", "physical attributes": "insults",
|
||||
}
|
||||
GROUP_NAMES = {"slurs": "_text_filter_slurs", "swearing": "_text_filter_swearing", "insults": "_text_filter_insults"}
|
||||
SEVERITIES = {"Mild": 1, "Strong": 2, "Severe": 3}
|
||||
SEVERITY_NAMES = {1: "mild", 2: "strong", 3: "severe"}
|
||||
RULES = {"anywhere": "_text_filter_anywhere", "start": "_text_filter_start", "whole": "_text_filter_whole"}
|
||||
FORMS = ("", "s", "es", "ed", "er", "ers", "ing", "y", "ies")
|
||||
|
||||
|
||||
def rot13(text):
|
||||
return codecs.encode(text, "rot13")
|
||||
|
||||
|
||||
def letters(text):
|
||||
"""a term's key: its letters, lowercase (spaces, hyphens, apostrophes
|
||||
and stops dropped); None for one with digits or other symbols"""
|
||||
text = text.lower()
|
||||
if re.search(r"[^a-z \-'.]", text):
|
||||
return None
|
||||
return re.sub(r"[^a-z]", "", text)
|
||||
|
||||
|
||||
def collapse(word):
|
||||
"""a word with each run of one letter made one ("batter" "bater")"""
|
||||
return re.sub(r"(.)\1+", r"\1", word)
|
||||
|
||||
|
||||
def read_review(path):
|
||||
review = {"keep": {}, "drop": set(), "term": {}}
|
||||
for number, line in enumerate(path.read_text().splitlines(), 1):
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
parts = line.split(None, 4 if line.startswith(("keep", "term")) else 1)
|
||||
kind = parts[0]
|
||||
if kind == "drop" and len(parts) == 2:
|
||||
review["drop"].add(rot13(parts[1]))
|
||||
elif kind in ("keep", "term") and len(parts) == 5:
|
||||
_, group, severity, rule, word = parts
|
||||
known_group = group in GROUP_NAMES or (kind == "keep" and group == "-")
|
||||
known_severity = severity == "-" or severity in SEVERITY_NAMES.values()
|
||||
if not known_group or not known_severity or (rule != "-" and rule not in RULES):
|
||||
sys.exit(f"{path}:{number}: a group, severity or rule this does not know")
|
||||
entry = (None if group == "-" else group, None if severity == "-" else
|
||||
{name: value for value, name in SEVERITY_NAMES.items()}[severity], None if rule == "-" else rule)
|
||||
review[kind][rot13(word)] = entry
|
||||
else:
|
||||
sys.exit(f"{path}:{number}: not a review line")
|
||||
return review
|
||||
|
||||
|
||||
def read_allowed(path):
|
||||
return [line.strip().lower() for line in path.read_text().splitlines()
|
||||
if line.strip() and not line.startswith("#")]
|
||||
|
||||
|
||||
class English:
|
||||
"""the English word list, for working out rules"""
|
||||
|
||||
def __init__(self, path):
|
||||
with gzip.open(path, "rt") as file:
|
||||
self.words = file.read().split()
|
||||
self.text = "\n" + "\n".join(self.words) + "\n"
|
||||
self.collapsed = "\n" + "\n".join(collapse(word) for word in self.words) + "\n"
|
||||
|
||||
@staticmethod
|
||||
def _find(text, key, own):
|
||||
found, at = [], 0
|
||||
while True:
|
||||
at = text.find(key, at)
|
||||
if at < 0:
|
||||
return found
|
||||
start = text.rindex("\n", 0, at) + 1
|
||||
end = text.index("\n", at)
|
||||
word = text[start:end]
|
||||
if word not in own:
|
||||
found.append(word)
|
||||
at = end
|
||||
|
||||
def containing(self, key):
|
||||
"""the words that the matcher would find the key in (the key, it with
|
||||
"ph" for "f" and "vv" for "w", or with any letter doubled), but its
|
||||
own forms: (word, whether it starts with the key)"""
|
||||
found = []
|
||||
for variant in {key, key.replace("f", "ph"), key.replace("w", "vv")}:
|
||||
own = {variant + form for form in FORMS}
|
||||
found += [(word, word.startswith(variant)) for word in self._find(self.text, variant, own)]
|
||||
short = collapse(variant)
|
||||
found += [(word, word.startswith(short)) for word in self._find(self.collapsed, short,
|
||||
{collapse(word) for word in own})]
|
||||
return found
|
||||
|
||||
def rule(self, key):
|
||||
others = self.containing(key)
|
||||
if len(key) >= 4 and not others:
|
||||
return "anywhere"
|
||||
if not any(starts for _, starts in others):
|
||||
return "start"
|
||||
return "whole"
|
||||
|
||||
|
||||
def build(csv_path, review, english):
|
||||
"""the terms: (group, severity, rule, key), and the base words the review
|
||||
has not named"""
|
||||
rows = list(csv.DictReader(open(csv_path, encoding="utf-8")))
|
||||
bases = defaultdict(list)
|
||||
for row in rows:
|
||||
forms = [row[f"canonical_form_{index}"] for index in (1, 2, 3) if row[f"canonical_form_{index}"]]
|
||||
for form in forms:
|
||||
bases[form].append((row, len(forms) == 1))
|
||||
unreviewed, kept = [], {}
|
||||
for base, base_rows in sorted(bases.items()):
|
||||
if base in review["drop"]:
|
||||
continue
|
||||
if base not in review["keep"]:
|
||||
unreviewed.append(base)
|
||||
continue
|
||||
own = [row for row, _ in base_rows if row["text"].lower() == base]
|
||||
category = own[0]["category_1"] if own else \
|
||||
Counter(row["category_1"] for row, _ in base_rows).most_common(1)[0][0]
|
||||
alone = [row for row, single in base_rows if single] or [row for row, _ in base_rows]
|
||||
group, severity, rule = review["keep"][base]
|
||||
kept[base] = (group or GROUPS[category],
|
||||
severity or max(SEVERITIES[row["severity_description"]] for row in alone),
|
||||
rule, [row["text"] for row, single in base_rows if single])
|
||||
terms = {}
|
||||
dropped = {letters(word) for word in review["drop"]}
|
||||
for base, (group, severity, rule, spellings) in kept.items():
|
||||
key = letters(base)
|
||||
if key:
|
||||
terms[key] = (group, severity, rule or english.rule(key))
|
||||
for base, (group, severity, rule, spellings) in kept.items():
|
||||
for spelling in spellings:
|
||||
key = letters(spelling)
|
||||
if not key or key in terms or key in dropped:
|
||||
continue
|
||||
terms[key] = (group, severity, None)
|
||||
for word, (group, severity, rule) in review["term"].items():
|
||||
key = letters(word)
|
||||
if not key:
|
||||
sys.exit(f"a review term has digits or symbols: {rot13(word)}")
|
||||
old = terms.get(key)
|
||||
terms[key] = (group, severity or (old[1] if old else 3), rule or (old[2] if old else None))
|
||||
for key, (group, severity, rule) in list(terms.items()):
|
||||
if rule is None:
|
||||
terms[key] = (group, severity, english.rule(key))
|
||||
# (a spelling another term finds: left out)
|
||||
found = {key for key, (group, severity, rule) in terms.items()
|
||||
if any(other != key and other in key and terms[other][2] == "anywhere" and terms[other][0] == group and
|
||||
terms[other][1] >= severity for other in terms)}
|
||||
result = sorted((group, severity, rule, key) for key, (group, severity, rule) in terms.items() if key not in found)
|
||||
return result, unreviewed, bases
|
||||
|
||||
|
||||
def template_line(base, base_rows, english):
|
||||
own = [row for row, _ in base_rows if row["text"].lower() == base]
|
||||
category = own[0]["category_1"] if own else Counter(row["category_1"] for row, _ in base_rows).most_common(1)[0][0]
|
||||
key = letters(base)
|
||||
rule = english.rule(key) if key else "-"
|
||||
return f"keep {GROUPS[category]} - {rule} {rot13(base)}"
|
||||
|
||||
|
||||
def c_string(key):
|
||||
return "".join(f"\\x{ord(character) ^ KEY:02X}" for character in key)
|
||||
|
||||
|
||||
def write_terms(terms, allowed, csv_path):
|
||||
digest = hashlib.sha256(Path(csv_path).read_bytes()).hexdigest() if csv_path else None
|
||||
lines = ["/* port/linux/game/text_filter_terms.inc: streamer mode's words, written by",
|
||||
"tools/text_filter_terms.py from Surge AI's profanity_en.csv",
|
||||
f"(sha256 {digest}) and port/assets/text_filter/review.txt and allow.txt.",
|
||||
"Each term's letters are xor'd with TEXT_FILTER_TERM_KEY. Do not edit. */", "",
|
||||
f"#define TEXT_FILTER_TERM_KEY 0x{KEY:02X}", "",
|
||||
"static struct text_filter_term_definition const text_filter_term_definitions[] =", "{"]
|
||||
for group, severity, rule, key in terms:
|
||||
lines.append(f'\t{{ {GROUP_NAMES[group]}, {severity}, {RULES[rule]}, "{c_string(key)}" }},')
|
||||
lines += ["};", "", "static char const *const text_filter_allowed_words[] =", "{"]
|
||||
lines += [f'\t"{word}",' for word in sorted(set(allowed))]
|
||||
lines += ["};", ""]
|
||||
TERMS_INC.write_text("\n".join(lines))
|
||||
|
||||
|
||||
def read_terms():
|
||||
"""the committed .inc's terms: (group, severity, rule, key)"""
|
||||
text = TERMS_INC.read_text()
|
||||
groups = {name: group for group, name in GROUP_NAMES.items()}
|
||||
rules = {name: rule for rule, name in RULES.items()}
|
||||
terms = []
|
||||
for group, severity, rule, encoded in re.findall(r'\{ (\w+), (\d), (\w+), "([^"]*)" \}', text):
|
||||
key = "".join(chr(int(byte, 16) ^ KEY) for byte in re.findall(r"\\x([0-9A-F]{2})", encoded))
|
||||
terms.append((groups[group], int(severity), rules[rule], key))
|
||||
return terms
|
||||
|
||||
|
||||
# ---------- characters above ASCII read as letters
|
||||
|
||||
# Greek and Cyrillic letters that look like Latin ones
|
||||
LOOK_ALIKES = {
|
||||
"α": "a", "β": "b", "γ": "y", "ε": "e", "η": "n", "ι": "i", "κ": "k", "ν": "v", "ο": "o", "ρ": "p", "τ": "t",
|
||||
"υ": "u", "χ": "x", "ω": "w", "Α": "a", "Β": "b", "Ε": "e", "Ζ": "z", "Η": "h", "Ι": "i", "Κ": "k", "Μ": "m",
|
||||
"Ν": "n", "Ο": "o", "Ρ": "p", "Τ": "t", "Υ": "y", "Χ": "x",
|
||||
"а": "a", "в": "b", "е": "e", "ё": "e", "ѕ": "s", "і": "i", "ї": "i", "ј": "j", "к": "k", "м": "m", "н": "h",
|
||||
"о": "o", "п": "n", "р": "p", "с": "c", "т": "t", "у": "y", "х": "x", "ь": "b", "ԁ": "d", "ӏ": "l", "г": "r",
|
||||
"А": "a", "В": "b", "Е": "e", "Ё": "e", "Ѕ": "s", "І": "i", "Ї": "i", "Ј": "j", "К": "k", "М": "m", "Н": "h",
|
||||
"О": "o", "Р": "p", "С": "c", "Т": "t", "У": "y", "Х": "x", "Ь": "b", "Ԁ": "d", "Ӏ": "l",
|
||||
"µ": "u", "ß": "sb", "ſ": "sf", "ı": "i", "ȷ": "j", "ł": "l", "Ł": "l", "ø": "o", "Ø": "o", "đ": "d", "Đ": "d",
|
||||
"ħ": "h", "Ħ": "h", "ŧ": "t", "Ŧ": "t", "æ": "a", "Æ": "a", "œ": "o", "Œ": "o", "þ": "p", "Þ": "p",
|
||||
}
|
||||
NAME = re.compile(r"^(?:LATIN|CIRCLED LATIN|PARENTHESIZED LATIN|LATIN SUBSCRIPT|SUPERSCRIPT LATIN) "
|
||||
r"(?:SMALL|CAPITAL) LETTER (?:SMALL CAPITAL )?([A-Z])(?: WITH .*| BAR| STROKE)?$")
|
||||
OTHER_NAMES = [re.compile(r"^LATIN LETTER SMALL CAPITAL ([A-Z])$"),
|
||||
re.compile(r"^MODIFIER LETTER (?:SMALL|CAPITAL) ([A-Z])$")]
|
||||
|
||||
|
||||
def fold_letters(code):
|
||||
character = chr(code)
|
||||
found = LOOK_ALIKES.get(character)
|
||||
if found is None:
|
||||
base = unicodedata.normalize("NFD", character)[0]
|
||||
found = LOOK_ALIKES.get(base) if base != character else None
|
||||
if found is None:
|
||||
name = unicodedata.name(character, "")
|
||||
for pattern in [NAME, *OTHER_NAMES]:
|
||||
match = pattern.match(name)
|
||||
if match:
|
||||
found = match.group(1).lower()
|
||||
break
|
||||
return found
|
||||
|
||||
|
||||
def write_fold():
|
||||
lines = ["/* port/linux/game/text_filter_fold.inc: the characters above ASCII that",
|
||||
"streamer mode reads as letters (a-z bits), written by tools/text_filter_terms.py",
|
||||
f"--fold from Unicode {unicodedata.unidata_version}'s names and its look-alikes. Do not edit. */", "",
|
||||
"static struct text_filter_fold const text_filter_folds[] =", "{"]
|
||||
for code in range(0x80, 0x10000):
|
||||
if 0xD800 <= code <= 0xDFFF or 0xFF01 <= code <= 0xFF5E:
|
||||
continue
|
||||
found = fold_letters(code)
|
||||
if found:
|
||||
bits = " | ".join(f"LETTER('{letter}')" for letter in sorted(set(found)))
|
||||
lines.append(f"\t{{ 0x{code:04X}, {bits} }},")
|
||||
lines += ["};", ""]
|
||||
FOLD_INC.write_text("\n".join(lines))
|
||||
|
||||
|
||||
def check(texts):
|
||||
"""the matcher's censoring of each text (all groups at mild), built as
|
||||
the harness builds it"""
|
||||
sys.path.insert(0, str(ROOT / "tools"))
|
||||
sys.path.insert(0, str(ROOT / "tools" / "harness" / "tests"))
|
||||
from harness import build # noqa: E402
|
||||
from test_text_filter import generated # noqa: E402
|
||||
executable = build("text_filter", generated(real=True))
|
||||
result = subprocess.run([str(executable), "--censor", "1", "1", "1"], input="\n".join(texts) + "\n",
|
||||
capture_output=True, text=True, check=True)
|
||||
return result.stdout.splitlines()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument("--surge", help="Surge AI's profanity_en.csv: write text_filter_terms.inc")
|
||||
parser.add_argument("--template", action="store_true", help="with --surge: a review line for each base word")
|
||||
parser.add_argument("--list", nargs="?", const="all", help="the terms, decoded (a group, or all)")
|
||||
parser.add_argument("--check", nargs="+", help="texts to try: what is hidden")
|
||||
parser.add_argument("--fold", action="store_true", help="write text_filter_fold.inc")
|
||||
arguments = parser.parse_args()
|
||||
if arguments.fold:
|
||||
write_fold()
|
||||
if arguments.surge:
|
||||
english = English(ENGLISH)
|
||||
review = read_review(REVIEW)
|
||||
terms, unreviewed, bases = build(arguments.surge, review, english)
|
||||
if arguments.template:
|
||||
for base in sorted(bases):
|
||||
print(template_line(base, bases[base], english))
|
||||
return
|
||||
if unreviewed:
|
||||
print("base words the review does not name (review.txt lines to start from):", file=sys.stderr)
|
||||
for base in unreviewed:
|
||||
print(template_line(base, bases[base], english), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
write_terms(terms, read_allowed(ALLOW), arguments.surge)
|
||||
print(f"{len(terms)} terms: " + ", ".join(f"{count} {group}" for group, count in
|
||||
sorted(Counter(term[0] for term in terms).items())))
|
||||
if arguments.list:
|
||||
for group, severity, rule, key in read_terms():
|
||||
if arguments.list in ("all", group):
|
||||
print(f"{group:9} {SEVERITY_NAMES[severity]:7} {rule:9} {key}")
|
||||
if arguments.check:
|
||||
for text, shown in zip(arguments.check, check(arguments.check)):
|
||||
print(f"{text!r} -> {shown!r}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -57,7 +57,7 @@ SDL_PORT = PORT_DIR / "halo_sdl3.py"
|
||||
# (the release port/web/halo_sdl3.py fetches, as the other builds')
|
||||
SDL_TAG = "release-3.4.16"
|
||||
# the page's fonts, the menus' own (port/assets/fonts)
|
||||
SITE_FONTS = ["OpenCE-Regular.ttf", "Overpass-750.ttf"]
|
||||
SITE_FONTS = ["OpenCE-Regular.ttf", "Overpass-750.ttf", "Overpass-900.ttf"]
|
||||
# the memory watch by page contents, shared with the Android host
|
||||
# (port/web/src/web_memory_watch.c)
|
||||
WATCH_HASH = ANDROID_DIR / "host" / "host_watch_hash.c"
|
||||
|
||||