Module necro.network.Netplay
Functions
applyResourceUpdate (targetResource, message) | |
getMessage (ev) | |
isPartialResourceUpdate (message) | |
makeMessage (messageType, messageData) |
Tables
GameState | |
MessageType | |
PlayerAttribute | |
Resource | |
RoomAttribute | |
SocketType |
Functions
- applyResourceUpdate (targetResource, message)
-
Parameters:
- targetResource
- message
- getMessage (ev)
-
Parameters:
- ev
- isPartialResourceUpdate (message)
-
Parameters:
- message
- makeMessage (messageType, messageData)
-
Parameters:
- messageType
- messageData
Tables
- GameState
-
Fields:
- UNINITIALIZED
0
- LOBBY
1
- IN_GAME
2
- UNINITIALIZED
- MessageType
-
Fields:
- LOGIN
1
- CLOCK_SYNC
2
- PLAYER_ATTRIBUTE
3
- PLAYER_ATTRIBUTE_LIST
4
- CHAT
5
- GAME_STATE
6
- PLAYER_INPUT
7
- DISCONNECT
8
- LATENCY_LIST
9
- RESOURCE
10
- SEQUENCE_SYNC
11
- SNAPSHOT_BROADCAST
12
- SNAPSHOT_REQUEST
13
- SNAPSHOT_RESPONSE
14
- HOST_CHANGE
15
- ROOM_CHANGE
16
- FAST_FORWARD
17
- LOCAL_COOP_ADD_PLAYER
18
- LOCAL_COOP_REMOVE_PLAYER
19
- LOCAL_COOP_PLAYER_INPUT
20
- LOCAL_COOP_PLAYER_ATTRIBUTE
21
- ROOM_ATTRIBUTE
22
- INPUT_UNLOCK_REQUEST
23
- LEVEL_COMPLETION_HINT
24
- SERVER_ATTRIBUTE
25
- LOGIN
- PlayerAttribute
-
Fields:
- ID
1
- The player's unique numeric ID. Starts at 1 and increments for each player in the server. - CONNECTED
2
- Flag indicating whether the player is currently connected. - LOGGED_IN
3
- Flag indicating whether the player has sent a log-in packet. - CLIENT_ID
4
- The player's client ID on the server-side network socket. - REJOIN_TOKEN
5
- The player's server-unique secret session token, allowing them to rejoin into their previous session. - ROOM_ID
6
- The ID of the room the player is currently or was most recently in. - ACTIVE_ROOM_ID
7
- The ID of the room the player is currently in. Set to nil for disconnected players. - NAME
8
- The player's username. Populated as soon as the client logs into the server. - LATENCY
9
- Client-server roundtrip latency in milliseconds. - CHARACTER
10
- User-settable string containing the name of the current character choice in the lobby. - INIT_CHARACTER
11
- (Deprecated!) Contains the player's character selection at the start of the run. - READY
12
- User-settable flag indicating whether the player has locked in their character choice and is ready to start. - RESOURCE_VERSIONS
13
- User-settable table mapping resource IDs to loaded versions. Must be equal for all players to start the game. - FAST_FORWARD_ACTIVE
14
- Flag indicating whether the player is currently fast-forwarding the game state to catch up with other players. - LOCAL_COOP_PARENT
15
- The ID of the "parent" player (for purposes of local co-op). Set to nil for individual or parent players. - LOCAL_COOP_PREVIOUS_PARENT
16
- The ID of the previous "parent" player (for purposes of local co-op). Preserved even after co-op dissociation. - LOCAL_COOP_CHILDREN
17
- The list of IDs of all "child" players (for purposes of local co-op). Set to nil for individual players. - MOD_HASHES
18
- The list of hashes of all loaded mods. Must be equal for all players to start the game. - HIDDEN
19
- If true, prevents the player from showing up in the client-side player list. - PEER_ID
20
- Peer-to-peer communication ID of the player (typically the Steam ID). - PUPPET
21
- If true, this player is not associated with a network connection and does not require synchronization. - SPECTATING
22
- If true, this player is spectating and will not have their character spawn in at the start of the run. - CUTSCENE_SKIP
23
- Requests for the cutscene with the specified ID to be skipped. - INPUT_LOCKED
24
- Indicates that this player is experiencing networking issues, causing their inputs to be dropped.
- ID
- Resource
-
Fields:
- DUNGEON
1
- GAME_SETTINGS
2
- MOD_LIST
3
- RNG_SEED
4
- REPLAY
5
- DUNGEON
- RoomAttribute
-
Fields:
- TEMPO_MULTIPLIER
1
- Playback speed factor. Mostly used for replays. - CHECKSUM
2
- Game state synchronization checksum. - PLAYER_LIST_RETENTION
3
- If true, player list entries are retained in the room even after the players disconnect. - CUTSCENE
4
- Contains information about the currently active cutscne. - READ_ONLY_SETTINGS
5
- If true, the host player is not allowed to edit the game settings or mod list of this room. - INPUT_LOCK_THRESHOLD
6
- Specifies the minimum turnID for inputs to be accepted.
- TEMPO_MULTIPLIER
- SocketType
-
Fields:
- LOCAL
0
- UDP
1
- STEAM
2
- STEAM_MULTI
3
- LOCAL