Commit graph

94 commits

Author SHA1 Message Date
2c4753e1b9 Bump tokio/warp versions 2021-02-13 15:01:28 -05:00
178309fb7d Bump env_logger version 2021-02-13 12:19:01 -05:00
76cde242bf Try to keep XY locations integral 2020-12-31 14:55:36 -05:00
1ef5565be1 Update dependencies 2020-11-06 12:52:28 -05:00
f624148464 Switch to processing connections via unified message select-loop 2020-07-09 22:02:30 -04:00
9b6c54900c update plan 2020-07-05 17:20:32 -04:00
82f1f81760 Adapt the socket in main without having to split it 2020-06-19 00:53:06 -04:00
7a793cf2c6 Adapt to whatever host serves the client 2020-06-10 00:41:11 -04:00
a499cb2064 Serve client files from server via RustEmbed, so they can be embedded for deployment. 2020-06-10 00:36:43 -04:00
4391ad521d Create space for multiple routes 2020-06-09 23:48:53 -04:00
ea2770105a Update input & state in response to client messages! 2020-06-08 22:58:42 -04:00
334ecc6eaf update player_id in sent-out SetState messages 2020-06-08 22:08:36 -04:00
9fcbc42a41 Send input state out to clients every tick 2020-06-08 20:09:31 -04:00
a16bd95c6a Store input state for each player 2020-06-08 20:06:02 -04:00
0c9e2e2a0e Accurately inform each connected player of their player id 2020-06-08 19:56:48 -04:00
a7dc49996f Give the message structs friendlier field names on the Rust side, because Serde lets us do that 2020-06-08 19:50:56 -04:00
c199e14435 Make the heartbeat task call the server's tick() method regularly.
The plumbing to get the tick task a reference to a server handle is a bit ugly;
some of the server methods should probably move to the handle impl instead.
2020-06-08 09:33:15 -04:00
3f07748abd Sync TICK_LENGTH constant between client & server 2020-06-07 01:56:06 -04:00
d2fe79b55c Spawn a heartbeat task while players are connected to the server, aborting it once they're off. 2020-06-05 22:14:28 -04:00
9239c19cbe Abort the "send to client" task when the websocket is closed 2020-06-03 00:50:12 -04:00
dacb031443 Remove some generics & make some typedefs. 2020-05-30 20:08:02 -04:00
eee34eb3ff tidy up 2020-05-30 19:16:50 -04:00
43babbbfab Maintain state records for connected players 2020-05-30 16:10:55 -04:00
750cfe1630 Create a PlayerId typedef, don't overload -1 for unassigned. 2020-05-26 23:32:28 -04:00
764e4d85cf Build out skeleton of server message processing flow 2020-05-25 23:38:18 -04:00
48ab9547ed Bizarre hack that seems to fix the type_length_limit error, but I'm not sure why 2020-05-25 23:24:55 -04:00
319f082d53 move client logic into one async fn 2020-05-25 22:17:44 -04:00
f83aab0c9e Split "parsing" and "processing" phases of input stream 2020-05-25 20:06:50 -04:00
2f64708e4e tidy up main.rs 2020-05-25 18:35:01 -04:00
eb7ea021b0 hide some generics that don't need to be generic 2020-05-24 23:14:25 -04:00
03e4512839 Move greeting into its own function, tidy up error path. 2020-05-24 20:53:30 -04:00
cf513ace26 Move HELO to actually come from the server 2020-05-23 14:24:49 -04:00
3ac90e59b0 Move websocket handler into dedicated function 2020-05-22 22:50:28 -04:00
f04822fcf0 only one client per page 2020-05-18 22:12:27 -04:00
0fab0e8c56 Create Serde structs for messages 2020-05-18 22:12:11 -04:00
e5c68b0c37 Fix prediction from null state to permit local prediction before server starts sending input. 2020-05-18 19:44:19 -04:00
e9c73ae998 Implement connection to websocket server 2020-05-17 23:47:50 -04:00
6491588223 Add proper "helo" message to protocol so client can be sure server is ready to receive input. 2020-05-17 23:39:28 -04:00
9df57e4aa9 Tidy typings for client server-connection dependency injection 2020-05-17 23:17:39 -04:00
9798687693 debug-log received websocket messages 2020-05-17 00:43:56 -04:00
ca5bf65e9d Change message type enum to serde-friendly strings; remove unused Ping message 2020-05-12 23:00:06 -04:00
a22ca95d3d Clarify error when unable to parse listen address 2020-05-11 08:59:23 -04:00
d031061c41 Create stub server in Rust using Warp to handle websockets. 2020-05-10 20:06:20 -04:00
5c9552fe49 lowercase folders for Rust convention compatibility 2020-05-10 18:47:03 -04:00
c620e4c982 Reset state on client connection instead of as a special manipulation of the local server. 2020-05-09 22:08:22 -04:00
7c06ab473d Break up client & server message handling logic into their own functions for better readability. 2020-05-09 22:07:42 -04:00
6427361d7b Fix typing for server in index.ts 2020-05-09 19:25:50 -04:00
44872c3d0e avoid accidental js spamming the project 2020-05-09 19:25:39 -04:00
c9f3a96662 tidy+update packages 2020-05-09 17:55:46 -04:00
a8b5dea37a Share one server instance between two client instances! 2020-05-02 21:22:57 -04:00