* Update to glutin 0.29.0, winit 0.27.0. Closes#695
Change true/false to CursorGrabMode::Locked/None for set_cursor_grab
https://github.com/rust-windowing/winit/releases/tag/v0.27.0
> Breaking: Window::set_cursor_grab now accepts CursorGrabMode to control grabbing behavior.
* Update web-sys to 0.3.59. Closes#699
* Update flate2 to 1.0.24. Closes#698
* Update zip to 0.6.2. Closes#697
* Update to log 0.4.17. Closes#696
The game was previously focused after clicking the done button in the individual settings, which would cause the game to be focused while still in the main settings menu.
As most people know, Freenode has changed owners and a lot of stuff
happened since. No need to go into details here, but all IRC channels on
the network are gone and control by channel operators is lost.
The channel wasn't really used anyway, so let's stop mentioning it
While the package lock is useful to consistently include the same
versions of each package, right now it causes too much noise with
dependabot, as new versions are released but with little or no impact on
this project because the web port is not yet usable (see #446🕸️ Web
support)
Implements support for receiving chat messages from the server, the
first step towards #63 chat support. Long way to go, but is a start.
* server: handle ServerMessage_* packets, on_servermessage
* format: get the with arguments of translations
* format: hardcode chat types
* format: support bare strings, used in chat.type.text
* format: use extra text if present, fixes missing username on 1.16.5
* console/main/server: activate on receiving chat messages
* console: write to log file (configdir/client.log)
* console: change to log only Info and more important to terminal (but all to file)
* console: configurable log levels
Updates to enhance GitHub Actions continuous integration:
* ci: add macOS app bundle packaging using cargo-bundle, closes#352
based on https://github.com/EndlessSkyCommunity/ESLauncher2/blob/master/Cargo.toml
* ci: add web target, building using wasm-pack (for #446)
* ci: refactor and cleanup targets, split out instead of using matrix
* main: save config in consistent OS-specific dirs::config_dir()
Instead of storing and loading in the current working directory, change
to a consistent dedicated configuration directory. This is necessary for
.app launching since cwd is set to /. To preserve compatibility with
existing installations, if conf.cfg exists in cwd then it will be used instead,
but otherwise we will use the operating system specific config dirs:
// Lin: Some(/home/alice/.config)
// Win: Some(C:\Users\Alice\AppData\Roaming)
// Mac: Some(/Users/Alice/Library/Application Support)
* macos: add icons based on screenshotted logo
* macos: add Cmd-Q to quit
PlayerInfo post-1.7.10 has the UUID, so it populates the self.players map,
in 1.7.10 there is only enough information for the client <tab> list. To fix
this, instead populate self.players in SpawnPlayer, for the 1.7.10 variant.
Fixes player name tags showing as "MISSING" on 1.7.10 servers.
* Fix Cmd-V typing v, suppress key_type on ctrl/logo, closes#432
Only send key_type() when modifiers are not pressed.
* Fix backspace repeat and inserting ⌂, closes#476
Handle backspace in key_type instead of key_press, so we get
auto-repeat for free, and can suppress typing the character.
Since the unflattening in 1.13.x, block IDs are no longer stable across versions, and
can be shifted by the addition of new block states. To get the right block IDs across
multiple protocol versions, add a new `offsets` token to `define_blocks!`, which
is similar to `offset` (used post-flattening, compare to `data` used pre-flattening),
but accepts a protocol_version argument to enable block states _per-version_:
* Add 'offsets' for protocol_version-specific blockstates
As part of this change, by_vanilla_id is now a method of a VanillaIDMap instance,
instead of a method of Block, so it can know the protocol version. Previously, the
ID map was lazily computed statically, once, but this change allows it to be
computed based on protocol version:
* Move by_vanilla_id to VanillaIDMap instance
Tools to help debug blocks:
* Add DEBUG_BLOCKS environment variable to dump block states
* Add dump_block command-line tool
The block `offset`s were previously only correct for 1.13.2, to take advantage of
the new version-specific `offsets` capability, blocks were updated for 1.14.x:
1.14+ (protocol_version >= 477):
* Add NoteBlock instruments
* Add FlowerPot and RedFlowerVariant cornflower, wither rose, lily of the valley
* Add StandingSign wood variants
* Add WallSign tree variants
* Add StoneSlab smooth stone, cut sandstone, cut red sandstone
This fixes#467, where grass was misinterpreted as fire on 1.14+ because of the
ID shifts caused by NoteBlock, among other block misassignments (though not 100%).
Fixes tallgrass showing up as dead bushes and also ferns. The flattened
IDs are in a different order than the pre-flattening data values, as observed
by enabling the commented-out block state logging.
Refactor the chunk builder to use multithreading on native, but no threads on
wasm, at least until we have web workers or wasm threads. With this change
and the shader fix, chunks now render on Chrome (albeit with no textures).
Another step towards 🕸️ Web support #446.
* Single-threaded chunk builder
* shaders: chunk_frag: consistently enable outputs, fixes GL_INVALID_OPERATION on WebGL
On the web, we have a separate render_loop (for window.requestAnimationFrame)
and events_loop (for winit/window events), so `game` and `ui_container` are shared
using an `Rc<RefCell>`, and `winit_window` as well for wasm only (on native,
`glutin_window` which provides access to the winit window is used instead).
With these changes, events (hover, click, etc.) and rendering now work in the web.
Another step towards 🕸️ Web support (#446)
* wasm: enable events loop
* Use Rc<RefCell>'s for winit_window
* Use Rc<RefCell> for game and ui_container
* main: disable set_cursor_grab() call on wasm to get further until Pointer Lock is available
At this point, the UI renders in the browser through WebGL, with no GL errors.
Progress towards #446🕸️ Web support
* main: enable render loop on wasm, disable events_loop on wasm for now
Allow for testing rendering on WebGL
* chunk_builder: disable on wasm due to no threads on wasm
Chunks will not be correctly rendered, but other parts of the program now can be tested instead of crashing in std::thread
* chunk_frag: glBindFragDataLocation is only on native, WebGL 2 uses in-shader specification layout(location=), which works on native in OpenGL 4.1 but we're on OpenGL 3.2 - see https://www.khronos.org/opengl/wiki/Fragment_Shader#Output_buffers
* std_or_web: always fail File::open() to avoid servers.json empty string JSON parse failing
* www: update installation instructions
* render: fix apparent TEXTURE_MAX_LEVEL -> TEXTURE_MAG_FILTER typo
* render: correct type for internalFormat DEPTH_COMPONENT24
Valid combinations of format, type, and internalFormat are listed at https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf#page=124&zoom=100,168,206. We had UNSIGNED_BYTE for DEPTH_COMPONENT24, but only UNSIGNED_INT is a valid type for this internal format.
Fixes texImage: Mismatched internalFormat and format/type: 0x81a6 and 0x1902/0x1401
and fixes the subsequent GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error.
* render: gl::MULTISAMPLE (0x809d) is not available on WebGL
Fixes WebGL warning: enabled: cap: Invalid enum value <enum 0x809d> 0.bootstrap.js line 11 > eval:851:21
* gl: replace set_float_multi_raw with a safer set_float_multi
Removes use of passing raw pointers in set_float_multi_raw parameters
Instead, casts raw pointers to flatten, similar to set_matrix_multi
Fixes uniform setter: (uniform colorMul[0]) values length (1) must be a positive integer multiple of size of <enum 0x8b52>.
* render: model: send BYTE to id attrib, fixes type mismatch
Fixes drawElementsInstanced: Vertex attrib 0 requires data of type INT, but is being supplied with type UINT
* Add getrandom with js feature for JavaScript web compatibility
* Update to rand 0.8.0, closes#440
* Update to rand_pcg 0.3.0, closes#434
* Update rsa_public_encrypt_pkcs1 to 0.3.0, updates rand 0.8.0
Replace std::time with the `instant` crate, which bridges to std::time on
native but on wasm calls performance.now() instead of panicking.
A step towards 🕸️ Web support #446
* logo: replace SystemTime/UNIX_EPOCH with Instant