Merge branch 'network-expansion' into server-expansion
This commit is contained in:
@@ -35,6 +35,7 @@ struct CharacterPacket : SerialPacketBase {
|
|||||||
|
|
||||||
//the owner
|
//the owner
|
||||||
int accountIndex;
|
int accountIndex;
|
||||||
|
//TODO: Authentication token?
|
||||||
|
|
||||||
//location
|
//location
|
||||||
int roomIndex;
|
int roomIndex;
|
||||||
|
|||||||
@@ -33,7 +33,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 = 20140909;
|
constexpr int NETWORK_VERSION = -1;
|
||||||
|
|
||||||
union MaxPacket {
|
union MaxPacket {
|
||||||
CharacterPacket a;
|
CharacterPacket a;
|
||||||
|
|||||||
@@ -46,21 +46,19 @@ enum class SerialPacketType {
|
|||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//ClientPacket
|
//ClientPacket
|
||||||
// client index, account index, character index
|
// client index, account index, username
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//Connecting to a server as a client
|
//Connecting to a server as a client
|
||||||
JOIN_REQUEST,
|
JOIN_REQUEST,
|
||||||
JOIN_RESPONSE,
|
JOIN_RESPONSE,
|
||||||
|
|
||||||
//client requests all information from the server
|
|
||||||
SYNCHRONIZE,
|
|
||||||
|
|
||||||
//disconnect from the server
|
//disconnect from the server
|
||||||
DISCONNECT,
|
DISCONNECT_REQUEST,
|
||||||
|
DISCONNECT_FORCED,
|
||||||
|
|
||||||
//shut down the server
|
//shut down the server
|
||||||
SHUTDOWN,
|
SHUTDOWN_REQUEST,
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//RegionPacket
|
//RegionPacket
|
||||||
@@ -73,20 +71,33 @@ enum class SerialPacketType {
|
|||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//CharacterPacket
|
//CharacterPacket
|
||||||
// handle, avatar, character index, account index,
|
// character index,
|
||||||
// room index, origin, motion
|
// handle, avatar,
|
||||||
|
// account index (owner),
|
||||||
|
// room index, origin, motion,
|
||||||
// statistics
|
// statistics
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
//controlling characters
|
//all stats
|
||||||
CHARACTER_NEW,
|
|
||||||
CHARACTER_DELETE,
|
|
||||||
CHARACTER_UPDATE,
|
|
||||||
|
|
||||||
//authentication, character index => character stats
|
|
||||||
CHARACTER_STATS_REQUEST,
|
CHARACTER_STATS_REQUEST,
|
||||||
CHARACTER_STATS_RESPONSE,
|
CHARACTER_STATS_RESPONSE,
|
||||||
|
|
||||||
|
//character management
|
||||||
|
//NOTE: The server sends create & delete messages to the clients, but the clients... don't?
|
||||||
|
CHARACTER_CREATE
|
||||||
|
CHARACTER_DELETE
|
||||||
|
CHARACTER_LOAD
|
||||||
|
CHARACTER_UNLOAD
|
||||||
|
|
||||||
|
//find out info from the server
|
||||||
|
CHARACTER_QUERY_EXISTS
|
||||||
|
CHARACTER_QUERY_LOCATION
|
||||||
|
|
||||||
|
//set the info in the server
|
||||||
|
CHARACTER_SET_ROOM
|
||||||
|
CHARACTER_SET_ORIGIN
|
||||||
|
CHARACTER_SET_MOTION
|
||||||
|
|
||||||
//-------------------------
|
//-------------------------
|
||||||
//TextPacket
|
//TextPacket
|
||||||
// name, text
|
// name, text
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
--TODO: An archive table of all dead characters
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS Accounts (
|
CREATE TABLE IF NOT EXISTS Accounts (
|
||||||
uid INTEGER PRIMARY KEY AUTOINCREMENT,
|
uid INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
username varchar(100) UNIQUE,
|
username varchar(100) UNIQUE,
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ private:
|
|||||||
std::string username;
|
std::string username;
|
||||||
//TODO: password
|
//TODO: password
|
||||||
|
|
||||||
|
//bit fields?
|
||||||
bool blackListed = false;
|
bool blackListed = false;
|
||||||
bool whiteListed = true;
|
bool whiteListed = true;
|
||||||
bool mod = false;
|
bool mod = false;
|
||||||
|
|||||||
@@ -22,6 +22,18 @@
|
|||||||
#ifndef SERVERAPPLICATION_HPP_
|
#ifndef SERVERAPPLICATION_HPP_
|
||||||
#define SERVERAPPLICATION_HPP_
|
#define SERVERAPPLICATION_HPP_
|
||||||
|
|
||||||
|
//managers
|
||||||
|
#include "account_manager.hpp"
|
||||||
|
#include "character_manager.hpp"
|
||||||
|
#include "client_manager.hpp"
|
||||||
|
#include "door_manager.hpp"
|
||||||
|
#include "monster_manager.hpp"
|
||||||
|
#include "room_manager.hpp"
|
||||||
|
|
||||||
|
//utilities
|
||||||
|
#include "config_utility.hpp"
|
||||||
|
#include "udp_network_utility.hpp"
|
||||||
|
|
||||||
//common utilities
|
//common utilities
|
||||||
#include "serial_packet.hpp"
|
#include "serial_packet.hpp"
|
||||||
#include "singleton.hpp"
|
#include "singleton.hpp"
|
||||||
|
|||||||
@@ -21,16 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "server_application.hpp"
|
#include "server_application.hpp"
|
||||||
|
|
||||||
//managers
|
|
||||||
#include "account_manager.hpp"
|
|
||||||
#include "character_manager.hpp"
|
|
||||||
#include "client_manager.hpp"
|
|
||||||
#include "room_manager.hpp"
|
|
||||||
|
|
||||||
//utilities
|
|
||||||
#include "config_utility.hpp"
|
|
||||||
#include "udp_network_utility.hpp"
|
|
||||||
|
|
||||||
//utility functions
|
//utility functions
|
||||||
#include "sql_tools.hpp"
|
#include "sql_tools.hpp"
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ void ServerApplication::PumpPacket(SerialPacket* const argPacket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//??
|
//SET: utility
|
||||||
void ServerApplication::PumpCharacterUnload(int uid) {
|
void ServerApplication::PumpCharacterUnload(int uid) {
|
||||||
//delete the client-side character(s)
|
//delete the client-side character(s)
|
||||||
//NOTE: This is a strange function
|
//NOTE: This is a strange function
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ TODO: I need a better way to handle the statistics
|
|||||||
TODO: Fix shoddy movement
|
TODO: Fix shoddy movement
|
||||||
TODO: Handle statistics server-side
|
TODO: Handle statistics server-side
|
||||||
TODO: Periodic mass server saves
|
TODO: Periodic mass server saves
|
||||||
|
TODO: join vs login
|
||||||
|
|
||||||
TODO: Remove the big "Shut Down" button
|
TODO: Remove the big "Shut Down" button
|
||||||
TODO: Make a way for the server owner to control the server directly
|
TODO: Make a way for the server owner to control the server directly
|
||||||
|
|||||||
Reference in New Issue
Block a user