The character is visible, fixed a database issue

This commit is contained in:
Kayne Ruse
2014-06-14 22:37:21 +10:00
parent d4be22a6eb
commit c021032512
6 changed files with 36 additions and 12 deletions
-1
View File
@@ -301,7 +301,6 @@ void InWorld::HandleCharacterNew(CharacterPacket* const argPacket) {
localCharacter = &character;
//setup the camera
//TODO: can't change the screen size?
camera.width = GetScreen()->w;
camera.height = GetScreen()->h;
+7 -1
View File
@@ -238,5 +238,11 @@ void LobbyMenu::HandleJoinResponse(ClientPacket* const argPacket) {
network.Bind(&argPacket->srcAddress, Channels::SERVER);
SetNextScene(SceneList::INWORLD);
//TODO: send this player's character info
//send this player's character info
CharacterPacket newPacket;
newPacket.type = SerialPacketType::CHARACTER_NEW;
strncpy(newPacket.handle, config["client.handle"].c_str(), PACKET_STRING_SIZE);
strncpy(newPacket.avatar, config["client.avatar"].c_str(), PACKET_STRING_SIZE);
newPacket.accountIndex = accountIndex;
network.SendTo(Channels::SERVER, &newPacket);
}
+10
View File
@@ -21,6 +21,11 @@
*/
#include "main_menu.hpp"
#include <iostream>
using std::cout;
using std::endl;
//-------------------------
//Public access members
//-------------------------
@@ -53,6 +58,11 @@ MainMenu::MainMenu(ConfigUtility* const argConfig):
startButton.SetText("Start");
optionsButton.SetText("Options");
quitButton.SetText("Quit");
//debug
cout << config["client.username"] << endl;
cout << config["client.handle"] << endl;
cout << config["client.avatar"] << endl;
}
MainMenu::~MainMenu() {