Began expanding network protocols for monsters

All big feature expansions have begun with SerialPacketType, and this is
no exception.
This commit is contained in:
Kayne Ruse
2015-01-13 00:04:42 +11:00
parent 1923f90329
commit de1cd8d6a8
3 changed files with 55 additions and 39 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
typedef SerialPacketBase SerialPacket;
//DOCS: NETWORK_VERSION is used to discern compatible servers and clients
constexpr int NETWORK_VERSION = 20141227;
constexpr int NETWORK_VERSION = -1;
union MaxPacket {
CharacterPacket a;
+54 -35
View File
@@ -30,7 +30,7 @@
//TODO: This needs to be smoothed out
enum class SerialPacketType {
//default: there is something wrong
NONE = 0,
NONE,
//-------------------------
//ServerPacket
@@ -38,12 +38,12 @@ enum class SerialPacketType {
//-------------------------
//heartbeat
PING = 1,
PONG = 2,
PING,
PONG,
//Used for finding available servers
BROADCAST_REQUEST = 3,
BROADCAST_RESPONSE = 4,
BROADCAST_REQUEST,
BROADCAST_RESPONSE,
//-------------------------
//ClientPacket
@@ -51,24 +51,24 @@ enum class SerialPacketType {
//-------------------------
//Connecting to a server as a client
JOIN_REQUEST = 5,
JOIN_RESPONSE = 6,
JOIN_REQUEST,
JOIN_RESPONSE,
//disconnect from the server
DISCONNECT_REQUEST = 7,
DISCONNECT_RESPONSE = 8,
DISCONNECT_FORCED = 9,
DISCONNECT_REQUEST,
DISCONNECT_RESPONSE,
DISCONNECT_FORCED,
//load the account
LOGIN_REQUEST = 10,
LOGIN_RESPONSE = 11,
LOGIN_REQUEST,
LOGIN_RESPONSE,
//unload the account
LOGOUT_REQUEST = 12,
LOGOUT_RESPONSE = 13,
LOGOUT_REQUEST,
LOGOUT_RESPONSE,
//shut down the server
SHUTDOWN_REQUEST = 14,
SHUTDOWN_REQUEST,
//-------------------------
//RegionPacket
@@ -76,8 +76,8 @@ enum class SerialPacketType {
//-------------------------
//map data
REGION_REQUEST = 15, //NOTE: technically a query
REGION_CONTENT = 16,
REGION_REQUEST, //NOTE: technically a query
REGION_CONTENT,
//-------------------------
//CharacterPacket
@@ -89,22 +89,40 @@ enum class SerialPacketType {
//-------------------------
//character management
CHARACTER_CREATE = 17,
CHARACTER_DELETE = 18,
CHARACTER_LOAD = 19,
CHARACTER_UNLOAD = 20,
CHARACTER_CREATE,
CHARACTER_DELETE,
CHARACTER_LOAD,
CHARACTER_UNLOAD,
//find out info from the server
QUERY_CHARACTER_EXISTS = 21,
QUERY_CHARACTER_STATS = 22,
QUERY_CHARACTER_LOCATION = 23,
QUERY_CHARACTER_EXISTS,
QUERY_CHARACTER_STATS,
QUERY_CHARACTER_LOCATION,
//set the info in the server
CHARACTER_SET_ROOM = 24,
CHARACTER_SET_ORIGIN = 25,
CHARACTER_SET_MOTION = 26,
CHARACTER_MOVEMENT,
CHARACTER_ATTACK,
//TODO: enemy management
//admin control
// ADMIN_SET_CHARACTER_ORIGIN,
//-------------------------
//MonsterPacket
// monster index,
// handle, avatar, hitbox?
// room index, origin, motion
// TODO: attack data
//-------------------------
MONSTER_CREATE,
MONSTER_DELETE,
QUERY_MONSTER_EXISTS, //a list of monsters in a room
QUERY_MONSTER_STATS, //statistics of a specific monster type or instance
QUERY_MONSTER_LOCATION, //umm...
MONSTER_MOVEMENT, //monster movement
MONSTER_ATTACK,
//-------------------------
//TextPacket
@@ -112,20 +130,21 @@ enum class SerialPacketType {
//-------------------------
//general speech
TEXT_BROADCAST = 27,
TEXT_BROADCAST,
//rejection/error messages
JOIN_REJECTION = 28,
LOGIN_REJECTION = 29,
REGION_REJECTION = 30,
CHARACTER_REJECTION = 31,
SHUTDOWN_REJECTION = 32,
JOIN_REJECTION,
LOGIN_REJECTION,
REGION_REJECTION,
CHARACTER_REJECTION,
MONSTER_REJECTION,
SHUTDOWN_REJECTION,
//-------------------------
//not used
//-------------------------
LAST = 33
LAST
};
#endif
-3
View File
@@ -1,7 +1,5 @@
TODO: In need of script APIs (list)
* Characters
* Monsters
* Waypoints
TODO: Account passwords (list)
* backbone account server OR
@@ -9,7 +7,6 @@ TODO: Account passwords (list)
* ...
* salts & hashes
TODO: Waypoints, with positions and trigger zones (collision areas) for doors, monster spawns, etc.
TODO: Fix shoddy movement
TODO: Periodic mass server saves
TODO: Remove the big "Shut Down" button (currently broken...)