2 * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
8 #include "world_info.h"
9 #include "vg/vg_platform.h"
14 typedef struct netmsg_blank netmsg_blank
;
15 enum{ k_inetmsg_blank
= 0 };
20 /* send after version */
21 typedef struct netmsg_auth netmsg_auth
;
22 enum{ k_inetmsg_auth
= 1 };
31 /* version should be sent before auth */
32 typedef struct netmsg_version netmsg_version
;
33 enum{ k_inetmsg_version
= 2 };
34 struct netmsg_version
{
39 /* server control 100 */
41 /* player updates 200 */
43 #define NETMSG_BOUNDARY_BIT 0x8000
44 #define NETMSG_GATE_BOUNDARY_BIT 0x4000
45 #define NETMSG_BOUNDARY_MASK (NETMSG_BOUNDARY_BIT|NETMSG_GATE_BOUNDARY_BIT)
46 #define NETMSG_PLAYERFRAME_INSTANCE_ID 0x3
47 #define NETMSG_PLAYERFRAME_HAVE_GLIDER 0x4
48 #define NETMSG_PLAYERFRAME_GLIDER_ORPHAN 0x8
50 typedef struct netmsg_playerframe netmsg_playerframe
;
51 enum{ k_inetmsg_playerframe
= 200 };
52 struct netmsg_playerframe
{
58 u16 boundary_hash
; /* used for animating correctly through gates, teleport..
59 msb is a flip flop for teleporting
60 second msb is flip flop for gate */
65 typedef struct netmsg_playerjoin netmsg_playerjoin
;
66 enum{ k_inetmsg_playerjoin
= 201 };
67 struct netmsg_playerjoin
{
73 typedef struct netmsg_playerleave netmsg_playerleave
;
74 enum{ k_inetmsg_playerleave
= 202 };
75 struct netmsg_playerleave
{
80 typedef struct netmsg_playerusername netmsg_playerusername
;
81 enum{ k_inetmsg_playerusername
= 203 };
82 struct netmsg_playerusername
{
88 typedef struct netmsg_playeritem netmsg_playeritem
;
89 enum{ k_inetmsg_playeritem
= 204 };
90 struct netmsg_playeritem
{
96 enum netmsg_playeritem_type
{
97 k_netmsg_playeritem_board
= 0,
98 k_netmsg_playeritem_player
,
99 k_netmsg_playeritem_world0
,
100 k_netmsg_playeritem_world1
,
101 k_netmsg_playeritem_max
104 typedef struct netmsg_chat netmsg_chat
;
105 enum{ k_inetmsg_chat
= 205 };
112 typedef struct netmsg_region netmsg_region
;
113 enum{ k_inetmsg_region
= 206 };
114 struct netmsg_region
{
122 typedef struct netmsg_request netmsg_request
;
123 enum{ k_inetmsg_request
= 300, k_inetmsg_response
= 301 };
124 struct netmsg_request
{
130 enum request_status
{
131 k_request_status_client_error
= 0,
132 k_request_status_invalid_endpoint
= 1,
133 k_request_status_unauthorized
= 2,
135 k_request_status_server_error
= 100,
136 k_request_status_out_of_memory
= 101,
137 k_request_status_database_error
= 102,
139 k_request_status_ok
= 200,
140 k_request_status_not_found
= 201
144 #endif /* NETWORK_MSG_H */