Re-added the network version
This commit is contained in:
@@ -71,7 +71,6 @@ void InWorld::HandleMonsterDelete(MonsterPacket* const argPacket) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//remove this monster
|
//remove this monster
|
||||||
monsterMap.erase(monsterIt);
|
monsterMap.erase(monsterIt);
|
||||||
|
|
||||||
@@ -100,7 +99,14 @@ void InWorld::HandleMonsterQueryExists(MonsterPacket* const argPacket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InWorld::HandleMonsterMovement(MonsterPacket* const argPacket) {
|
void InWorld::HandleMonsterMovement(MonsterPacket* const argPacket) {
|
||||||
//TODO: HandleMonsterMovement
|
//ignore if this monster doesn't exist
|
||||||
|
std::map<int, BaseMonster>::iterator monsterIt = monsterMap.find(argPacket->monsterIndex);
|
||||||
|
if (monsterIt == monsterMap.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
monsterIt.SetOrigin(argPacket->origin);
|
||||||
|
monsterIt.SetOrigin(argPacket->motion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InWorld::HandleMonsterAttack(MonsterPacket* const argPacket) {
|
void InWorld::HandleMonsterAttack(MonsterPacket* const argPacket) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
typedef SerialPacketBase SerialPacket;
|
typedef SerialPacketBase SerialPacket;
|
||||||
|
|
||||||
//DOCS: NETWORK_VERSION is used to discern compatible servers and clients
|
//DOCS: NETWORK_VERSION is used to discern compatible servers and clients
|
||||||
constexpr int NETWORK_VERSION = -1;
|
constexpr int NETWORK_VERSION = 20150205;
|
||||||
|
|
||||||
union MaxPacket {
|
union MaxPacket {
|
||||||
CharacterPacket a;
|
CharacterPacket a;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
//TODO: This needs to be smoothed out
|
//TODO: This needs to be smoothed out
|
||||||
enum class SerialPacketType {
|
enum class SerialPacketType {
|
||||||
//default: there is something wrong
|
//default: there is something wrong
|
||||||
NONE,
|
NONE = 0,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//ServerPacket
|
//ServerPacket
|
||||||
@@ -38,12 +38,12 @@ enum class SerialPacketType {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//heartbeat
|
//heartbeat
|
||||||
PING,
|
PING = 1,
|
||||||
PONG,
|
PONG = 2,
|
||||||
|
|
||||||
//Used for finding available servers
|
//Used for finding available servers
|
||||||
BROADCAST_REQUEST,
|
BROADCAST_REQUEST = 3,
|
||||||
BROADCAST_RESPONSE,
|
BROADCAST_RESPONSE = 4,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//ClientPacket
|
//ClientPacket
|
||||||
@@ -51,24 +51,24 @@ enum class SerialPacketType {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//Connecting to a server as a client
|
//Connecting to a server as a client
|
||||||
JOIN_REQUEST,
|
JOIN_REQUEST = 5,
|
||||||
JOIN_RESPONSE,
|
JOIN_RESPONSE = 6,
|
||||||
|
|
||||||
//disconnect from the server
|
//disconnect from the server
|
||||||
DISCONNECT_REQUEST,
|
DISCONNECT_REQUEST = 7,
|
||||||
DISCONNECT_RESPONSE,
|
DISCONNECT_RESPONSE = 8,
|
||||||
DISCONNECT_FORCED,
|
DISCONNECT_FORCED = 9,
|
||||||
|
|
||||||
//load the account
|
//load the account
|
||||||
LOGIN_REQUEST,
|
LOGIN_REQUEST = 10,
|
||||||
LOGIN_RESPONSE,
|
LOGIN_RESPONSE = 11,
|
||||||
|
|
||||||
//unload the account
|
//unload the account
|
||||||
LOGOUT_REQUEST,
|
LOGOUT_REQUEST = 12,
|
||||||
LOGOUT_RESPONSE,
|
LOGOUT_RESPONSE = 13,
|
||||||
|
|
||||||
//shut down the server
|
//shut down the server
|
||||||
SHUTDOWN_REQUEST,
|
SHUTDOWN_REQUEST = 14,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//RegionPacket
|
//RegionPacket
|
||||||
@@ -76,8 +76,8 @@ enum class SerialPacketType {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//map data
|
//map data
|
||||||
REGION_REQUEST, //NOTE: technically a query
|
REGION_REQUEST = 15, //NOTE: technically a query
|
||||||
REGION_CONTENT,
|
REGION_CONTENT = 16,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//CharacterPacket
|
//CharacterPacket
|
||||||
@@ -89,19 +89,19 @@ enum class SerialPacketType {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//character management
|
//character management
|
||||||
CHARACTER_CREATE,
|
CHARACTER_CREATE = 17,
|
||||||
CHARACTER_DELETE,
|
CHARACTER_DELETE = 18,
|
||||||
CHARACTER_LOAD,
|
CHARACTER_LOAD = 19,
|
||||||
CHARACTER_UNLOAD,
|
CHARACTER_UNLOAD = 20,
|
||||||
|
|
||||||
//find out info from the server
|
//find out info from the server
|
||||||
QUERY_CHARACTER_EXISTS,
|
QUERY_CHARACTER_EXISTS = 21,
|
||||||
QUERY_CHARACTER_STATS,
|
QUERY_CHARACTER_STATS = 22,
|
||||||
QUERY_CHARACTER_LOCATION,
|
QUERY_CHARACTER_LOCATION = 23,
|
||||||
|
|
||||||
//set the info in the server
|
//set the info in the server
|
||||||
CHARACTER_MOVEMENT,
|
CHARACTER_MOVEMENT = 24,
|
||||||
CHARACTER_ATTACK,
|
CHARACTER_ATTACK = 25,
|
||||||
|
|
||||||
//admin control
|
//admin control
|
||||||
// ADMIN_SET_CHARACTER_ORIGIN,
|
// ADMIN_SET_CHARACTER_ORIGIN,
|
||||||
@@ -114,15 +114,15 @@ enum class SerialPacketType {
|
|||||||
// TODO: attack data
|
// TODO: attack data
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
MONSTER_CREATE,
|
MONSTER_CREATE = 26,
|
||||||
MONSTER_DELETE,
|
MONSTER_DELETE = 27,
|
||||||
|
|
||||||
QUERY_MONSTER_EXISTS, //a list of monsters in a room
|
QUERY_MONSTER_EXISTS = 28, //a list of monsters in a room
|
||||||
QUERY_MONSTER_STATS, //statistics of a specific monster type or instance
|
QUERY_MONSTER_STATS = 29, //statistics of a specific monster type or instance
|
||||||
QUERY_MONSTER_LOCATION, //umm...
|
QUERY_MONSTER_LOCATION = 30, //umm...
|
||||||
|
|
||||||
MONSTER_MOVEMENT, //monster movement
|
MONSTER_MOVEMENT = 31, //monster movement
|
||||||
MONSTER_ATTACK,
|
MONSTER_ATTACK = 32,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//TextPacket
|
//TextPacket
|
||||||
@@ -130,21 +130,21 @@ enum class SerialPacketType {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//general speech
|
//general speech
|
||||||
TEXT_BROADCAST,
|
TEXT_BROADCAST = 33,
|
||||||
|
|
||||||
//rejection/error messages
|
//rejection/error messages
|
||||||
JOIN_REJECTION,
|
JOIN_REJECTION = 34,
|
||||||
LOGIN_REJECTION,
|
LOGIN_REJECTION = 35,
|
||||||
REGION_REJECTION,
|
REGION_REJECTION = 36,
|
||||||
CHARACTER_REJECTION,
|
CHARACTER_REJECTION = 37,
|
||||||
MONSTER_REJECTION,
|
MONSTER_REJECTION = 38,
|
||||||
SHUTDOWN_REJECTION,
|
SHUTDOWN_REJECTION = 39,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//not used
|
//not used
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
LAST
|
LAST = 40
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user