Removed initial world query
The world is queried once the client has the player's character.
This commit is contained in:
@@ -88,10 +88,10 @@ void World::hCharacterCreate(CharacterPacket* const argPacket) {
|
||||
characterIndex = argPacket->characterIndex;
|
||||
roomIndex = argPacket->roomIndex;
|
||||
|
||||
//query the world state
|
||||
//query the world state (room)
|
||||
CharacterPacket newPacket;
|
||||
memset(&newPacket, 0, MAX_PACKET_SIZE);
|
||||
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS; //TODO: (1) the EXISTS and LOCATION queries are backwards?
|
||||
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
||||
newPacket.roomIndex = roomIndex;
|
||||
network.SendTo(Channels::SERVER, &newPacket);
|
||||
newPacket.type = SerialPacketType::QUERY_MONSTER_EXISTS;
|
||||
|
||||
@@ -71,14 +71,6 @@ World::World(int* const argClientIndex, int* const argAccountIndex):
|
||||
newPacket.accountIndex = accountIndex;
|
||||
network.SendTo(Channels::SERVER, &newPacket);
|
||||
|
||||
//TODO: (1) replace this duplication with a request for just this player's character
|
||||
//query the world state
|
||||
memset(&newPacket, 0, MAX_PACKET_SIZE);
|
||||
newPacket.type = SerialPacketType::QUERY_CHARACTER_EXISTS;
|
||||
network.SendTo(Channels::SERVER, &newPacket);
|
||||
newPacket.type = SerialPacketType::QUERY_MONSTER_EXISTS;
|
||||
network.SendTo(Channels::SERVER, &newPacket);
|
||||
|
||||
//set the camera's values
|
||||
camera.width = GetScreen()->w;
|
||||
camera.height = GetScreen()->h;
|
||||
|
||||
@@ -21,6 +21,7 @@ mapMaker.edges.south = 16
|
||||
mapMaker.edges.east = 1
|
||||
mapMaker.edges.west = -1
|
||||
|
||||
--TODO: (1) path system
|
||||
--use these macros (mapped to "overworld.bmp" for now) to smooth the region's edges
|
||||
function mapMaker.SmoothEdgesSimple(r)
|
||||
--make and pad an array to use
|
||||
|
||||
@@ -59,7 +59,7 @@ createTrigger("door 1", overworld, 128, -128, function(entity)
|
||||
end
|
||||
|
||||
local x, y = characterAPI.GetOrigin(entity)
|
||||
characterAPI.SetRoomIndex(entity, uidTwo) --TODO: (1) take exit coordinates as a parameter
|
||||
characterAPI.SetRoomIndex(entity, uidTwo) --TODO: (0) take exit coordinates as a parameter
|
||||
characterAPI.SetOrigin(entity, 0, 0)
|
||||
networkAPI.PumpCharacterUpdate(entity)
|
||||
end)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
static int setRoomIndex(lua_State* L) { //TODO: (1) take the room userdata as a parameter
|
||||
static int setRoomIndex(lua_State* L) { //TODO: (1) take the room userdata as a parameter?
|
||||
//NOTE: type-dependant calls to various API functions, see bug #43
|
||||
|
||||
//reverse engineer the character index
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
//TODO: (0) state-system for preventing double triggering
|
||||
class TriggerData {
|
||||
public:
|
||||
TriggerData() = default;
|
||||
|
||||
Reference in New Issue
Block a user