Expanded network protocol, read more
Not really doing much, just busywork with the server's handlers. I've tweaked the TODO tags as well.
This commit is contained in:
@@ -142,7 +142,7 @@ protected:
|
||||
LocalCharacter* localCharacter = nullptr;
|
||||
|
||||
//heartbeat
|
||||
//TODO: Heartbeat needs it's own utility
|
||||
//TODO: (9) Heartbeat needs it's own utility
|
||||
typedef std::chrono::steady_clock Clock;
|
||||
Clock::time_point lastBeat = Clock::now();
|
||||
int attemptedBeats = 0;
|
||||
|
||||
@@ -51,7 +51,7 @@ void InWorld::HandleCharacterCreate(CharacterPacket* const argPacket) {
|
||||
//fill the character's info
|
||||
character->SetOrigin(argPacket->origin);
|
||||
character->SetMotion(argPacket->motion);
|
||||
character->SetBounds({CHARACTER_BOUNDS_X, CHARACTER_BOUNDS_Y, CHARACTER_BOUNDS_WIDTH, CHARACTER_BOUNDS_HEIGHT}); //TODO: send the bounds from the server
|
||||
character->SetBounds({CHARACTER_BOUNDS_X, CHARACTER_BOUNDS_Y, CHARACTER_BOUNDS_WIDTH, CHARACTER_BOUNDS_HEIGHT}); //TODO: (1) send the bounds from the server
|
||||
character->SetHandle(argPacket->handle);
|
||||
character->SetAvatar(argPacket->avatar);
|
||||
character->SetOwner(argPacket->accountIndex);
|
||||
@@ -128,7 +128,7 @@ void InWorld::HandleCharacterQueryExists(CharacterPacket* const argPacket) {
|
||||
}
|
||||
|
||||
void InWorld::HandleCharacterMovement(CharacterPacket* const argPacket) {
|
||||
//TODO: Authentication
|
||||
//TODO: (1) Authentication
|
||||
if (argPacket->characterIndex == characterIndex) {
|
||||
return;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void InWorld::HandleCharacterMovement(CharacterPacket* const argPacket) {
|
||||
}
|
||||
|
||||
void InWorld::HandleCharacterAttack(CharacterPacket* const argPacket) {
|
||||
//TODO: attack animation
|
||||
//TODO: (1) attack animation
|
||||
}
|
||||
|
||||
//-------------------------
|
||||
|
||||
@@ -110,5 +110,5 @@ void InWorld::HandleMonsterMovement(MonsterPacket* const argPacket) {
|
||||
}
|
||||
|
||||
void InWorld::HandleMonsterAttack(MonsterPacket* const argPacket) {
|
||||
//TODO: HandleMonsterAttack
|
||||
//TODO: (1) HandleMonsterAttack
|
||||
}
|
||||
@@ -60,12 +60,10 @@ InWorld::InWorld(int* const argClientIndex, int* const argAccountIndex):
|
||||
shutDownButton.SetText("Shut Down");
|
||||
|
||||
//load the tilesheet
|
||||
//TODO: add the tilesheet to the map system
|
||||
//TODO: Tile size and tile sheet should be loaded elsewhere
|
||||
//TODO: (9) Tile size and tile sheet should be loaded elsewhere
|
||||
tileSheet.Load(config["dir.tilesets"] + "overworld.bmp", 32, 32);
|
||||
|
||||
//Send the character data
|
||||
//TODO: login scene, prompt, etc.
|
||||
CharacterPacket newPacket;
|
||||
newPacket.type = SerialPacketType::CHARACTER_LOAD;
|
||||
strncpy(newPacket.handle, config["client.handle"].c_str(), PACKET_STRING_SIZE);
|
||||
@@ -175,11 +173,10 @@ void InWorld::Render(SDL_Surface* const screen) {
|
||||
|
||||
//draw the entities
|
||||
for (auto& it : characterMap) {
|
||||
//TODO: depth ordering
|
||||
//TODO: (1) depth ordering
|
||||
it.second.DrawTo(screen, camera.x, camera.y);
|
||||
}
|
||||
for (auto& it : monsterMap) {
|
||||
//TODO: depth ordering
|
||||
it.second.DrawTo(screen, camera.x, camera.y);
|
||||
}
|
||||
|
||||
@@ -224,7 +221,7 @@ void InWorld::KeyDown(SDL_KeyboardEvent const& key) {
|
||||
//hotkeys
|
||||
switch(key.keysym.sym) {
|
||||
case SDLK_ESCAPE:
|
||||
//TODO: the escape key should actually control menus and stuff
|
||||
//TODO: (9) the escape key should actually control menus and stuff
|
||||
SendLogoutRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user