Minor file renaming and tweaks

This commit is contained in:
Kayne Ruse
2014-05-13 00:09:37 +10:00
parent 80a26341b1
commit 01244005e9
10 changed files with 14 additions and 37 deletions
+4
View File
@@ -367,7 +367,9 @@ void InWorld::RequestDisconnect() {
//send a disconnect request //send a disconnect request
packet.meta.type = SerialPacket::Type::DISCONNECT; packet.meta.type = SerialPacket::Type::DISCONNECT;
packet.clientInfo.clientIndex = clientIndex;
packet.clientInfo.accountIndex = accountIndex; packet.clientInfo.accountIndex = accountIndex;
packet.clientInfo.characterIndex = characterIndex;
serialize(&packet, buffer); serialize(&packet, buffer);
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE); network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
} }
@@ -378,7 +380,9 @@ void InWorld::RequestShutDown() {
//send a shutdown request //send a shutdown request
packet.meta.type = SerialPacket::Type::SHUTDOWN; packet.meta.type = SerialPacket::Type::SHUTDOWN;
packet.clientInfo.clientIndex = clientIndex;
packet.clientInfo.accountIndex = accountIndex; packet.clientInfo.accountIndex = accountIndex;
packet.clientInfo.characterIndex = characterIndex;
serialize(&packet, buffer); serialize(&packet, buffer);
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE); network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
} }
+3 -1
View File
@@ -27,7 +27,7 @@
#include "SDL/SDL_net.h" #include "SDL/SDL_net.h"
#define NETWORK_VERSION 20140506 #define NETWORK_VERSION 20140512
#define PACKET_STRING_SIZE 100 #define PACKET_STRING_SIZE 100
#pragma pack(push, 0) #pragma pack(push, 0)
@@ -42,6 +42,8 @@ union SerialPacket {
PING = 1, PING = 1,
PONG = 2, PONG = 2,
//TODO: rejection message
//Searching for a server to join //Searching for a server to join
BROADCAST_REQUEST = 3, BROADCAST_REQUEST = 3,
BROADCAST_RESPONSE = 4, BROADCAST_RESPONSE = 4,
@@ -19,7 +19,7 @@
* 3. This notice may not be removed or altered from any source * 3. This notice may not be removed or altered from any source
* distribution. * distribution.
*/ */
#include "server_utility.hpp" #include "sql_utility.hpp"
#include "utility.hpp" #include "utility.hpp"
@@ -186,6 +186,8 @@ void ServerApplication::DeleteUserAccount(int uid) {
throw( std::runtime_error(std::string() + "Unknown SQL error when deleting an account: " + sqlite3_errmsg(database)) ); throw( std::runtime_error(std::string() + "Unknown SQL error when deleting an account: " + sqlite3_errmsg(database)) );
} }
//TODO: delete this account's characters?
//finish the routine //finish the routine
sqlite3_finalize(statement); sqlite3_finalize(statement);
accountMap.erase(uid); accountMap.erase(uid);
-30
View File
@@ -1,30 +0,0 @@
/* Copyright: (c) Kayne Ruse 2014
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*/
#ifndef COMBATINSTANCE_HPP_
#define COMBATINSTANCE_HPP_
struct CombatInstance {
//uid
static int uidCounter;
};
#endif
-2
View File
@@ -26,7 +26,6 @@
#include "client_data.hpp" #include "client_data.hpp"
#include "account_data.hpp" #include "account_data.hpp"
#include "character_data.hpp" #include "character_data.hpp"
#include "combat_instance.hpp"
//maps //maps
#include "map_allocator.hpp" #include "map_allocator.hpp"
@@ -102,7 +101,6 @@ private:
std::map<int, ClientData> clientMap; std::map<int, ClientData> clientMap;
std::map<int, AccountData> accountMap; std::map<int, AccountData> accountMap;
std::map<int, CharacterData> characterMap; std::map<int, CharacterData> characterMap;
std::map<int, CombatInstance> combatMap;
//maps //maps
//TODO: I need to handle multiple map objects //TODO: I need to handle multiple map objects
+1 -2
View File
@@ -21,7 +21,7 @@
*/ */
#include "server_application.hpp" #include "server_application.hpp"
#include "server_utility.hpp" #include "sql_utility.hpp"
#include <stdexcept> #include <stdexcept>
#include <iostream> #include <iostream>
@@ -33,7 +33,6 @@
int ClientData::uidCounter = 0; int ClientData::uidCounter = 0;
int CharacterData::uidCounter = 0; int CharacterData::uidCounter = 0;
int CombatInstance::uidCounter = 0;
//------------------------- //-------------------------
//Define the public members //Define the public members
+3 -1
View File
@@ -1,4 +1,6 @@
I need to keep the documentation up to date. Namely, the GDD is getting out of date. * I need to keep the documentation up to date. Namely, the GDD is getting out of date.
* How many lookups is the map system using?
* Add the serial packet to the network utility
--Naming conventions-- --Naming conventions--