60 lines
1.8 KiB
C++
60 lines
1.8 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <Helpers/Networking/NetLibrary.hpp>
|
|
|
|
enum ServerCommands : MessageCommandType {
|
|
SERVER_FRAGMENT = 0,
|
|
SERVER_KEEP_ALIVE,
|
|
SERVER_INITIAL_DATA,
|
|
SERVER_MOVE_MOUSE,
|
|
SERVER_PLACE_SINGLE_COMPONENT,
|
|
SERVER_PLACE_MANY_COMPONENTS,
|
|
SERVER_TRANSFORM_MANY_COMPONENTS,
|
|
SERVER_ERASE_SINGLE_COMPONENT,
|
|
SERVER_ERASE_MANY_COMPONENTS,
|
|
SERVER_UPDATE_COMPONENT,
|
|
SERVER_RESOURCE_INIT,
|
|
SERVER_RESOURCE_DATA,
|
|
SERVER_CHAT_MESSAGE,
|
|
SERVER_NEW_BOOKMARK,
|
|
SERVER_REMOVE_BOOKMARK,
|
|
SERVER_CANVAS_COLOR,
|
|
SERVER_SET_GRID,
|
|
SERVER_REMOVE_GRID,
|
|
SERVER_CANVAS_SCALE
|
|
};
|
|
|
|
enum ClientCommands : MessageCommandType {
|
|
CLIENT_FRAGMENT = 0,
|
|
CLIENT_KEEP_ALIVE,
|
|
CLIENT_INITIAL_DATA,
|
|
CLIENT_USER_CONNECT,
|
|
CLIENT_USER_DISCONNECT,
|
|
CLIENT_PLACE_SINGLE_COMPONENT,
|
|
CLIENT_PLACE_MANY_COMPONENTS,
|
|
CLIENT_TRANSFORM_MANY_COMPONENTS,
|
|
CLIENT_ERASE_SINGLE_COMPONENT,
|
|
CLIENT_ERASE_MANY_COMPONENTS,
|
|
CLIENT_UPDATE_COMPONENT,
|
|
CLIENT_MOVE_MOUSE,
|
|
CLIENT_NEW_RESOURCE,
|
|
CLIENT_CHAT_MESSAGE,
|
|
CLIENT_NEW_BOOKMARK,
|
|
CLIENT_REMOVE_BOOKMARK,
|
|
CLIENT_CANVAS_COLOR,
|
|
CLIENT_SET_GRID,
|
|
CLIENT_REMOVE_GRID,
|
|
CLIENT_CANVAS_SCALE
|
|
};
|
|
|
|
// NOTE: Do not change savefile header length
|
|
#define SAVEFILE_HEADER_LEN 12
|
|
// NOTE: Change these values whenever savefile is incompatible with previous version
|
|
#define SAVEFILE_HEADER "INFPNT000003"
|
|
#define SAVEFILE_HEADER_V2 "INFPNT000002"
|
|
#define SAVEFILE_HEADER_V1 "INFPNT000001"
|
|
// Version header
|
|
#define VERSION_STRING "0.2.0"
|
|
|
|
// Arbitrary value. Higher scale up values lead to less scale up events (which can cause stuttering), but leads to larger numbers overall, which can cause a tiny bit of lag and increased memory usage
|
|
#define CANVAS_SCALE_UP_STEP WorldScalar("100000000000000000000000000000000000000000000000000")
|