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:
+10
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user