Players are being added in the client

The client sends a debug player to the server, with a constant movement to
show that the new client _is_ connecting. The next thing to add is the
sync system, so that the clients know what the server looks like when they
first join.
This commit is contained in:
Kayne Ruse
2013-06-24 16:15:48 +10:00
parent 2235f307e7
commit 3f2fcdf9e1
6 changed files with 101 additions and 49 deletions
+10 -4
View File
@@ -23,12 +23,14 @@
#define INWORLD_HPP_
#include "base_scene.hpp"
#include "utilities.hpp"
#include "defines.hpp"
#include "singleton.hpp"
#include "packet.hpp"
#include "network_queue.hpp"
#include "information_manager.hpp"
#include "player_character.hpp"
#include "config_utility.hpp"
#include "surface_manager.hpp"
@@ -37,8 +39,7 @@
#include "raster_font.hpp"
#include "frame_rate.hpp"
//debugging
#include "player_character.hpp"
#include <map>
class InWorld : public BaseScene {
public:
@@ -62,11 +63,16 @@ protected:
void KeyUp(SDL_KeyboardEvent const&);
//Utilities
int HandlePacket(Packet::Packet p);
int HandlePacket(Packet::Packet);
void Disconnect();
void ExitGame();
void HandleDisconnection(Packet::Disconnect&);
void AddPlayer(Packet::PlayerNew&);
void RemovePlayer(Packet::PlayerDelete&);
void UpdatePlayer(Packet::PlayerUpdate&);
//services
ConfigUtility* configUtil = Singleton<ConfigUtility>::Get();
SurfaceManager* surfaceMgr = Singleton<SurfaceManager>::Get();
@@ -75,7 +81,7 @@ protected:
//members
RasterFont font;
PlayerCharacter pc;
std::map<int, PlayerCharacter> playerCharacters;
};
#endif