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;
|
characterIndex = argPacket->characterIndex;
|
||||||
roomIndex = argPacket->roomIndex;
|
roomIndex = argPacket->roomIndex;
|
||||||
|
|
||||||
//query the world state
|
//query the world state (room)
|
||||||
CharacterPacket newPacket;
|
CharacterPacket newPacket;
|
||||||
memset(&newPacket, 0, MAX_PACKET_SIZE);
|
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;
|
newPacket.roomIndex = roomIndex;
|
||||||
network.SendTo(Channels::SERVER, &newPacket);
|
network.SendTo(Channels::SERVER, &newPacket);
|
||||||
newPacket.type = SerialPacketType::QUERY_MONSTER_EXISTS;
|
newPacket.type = SerialPacketType::QUERY_MONSTER_EXISTS;
|
||||||
|
|||||||
@@ -71,14 +71,6 @@ World::World(int* const argClientIndex, int* const argAccountIndex):
|
|||||||
newPacket.accountIndex = accountIndex;
|
newPacket.accountIndex = accountIndex;
|
||||||
network.SendTo(Channels::SERVER, &newPacket);
|
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
|
//set the camera's values
|
||||||
camera.width = GetScreen()->w;
|
camera.width = GetScreen()->w;
|
||||||
camera.height = GetScreen()->h;
|
camera.height = GetScreen()->h;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ mapMaker.edges.south = 16
|
|||||||
mapMaker.edges.east = 1
|
mapMaker.edges.east = 1
|
||||||
mapMaker.edges.west = -1
|
mapMaker.edges.west = -1
|
||||||
|
|
||||||
|
--TODO: (1) path system
|
||||||
--use these macros (mapped to "overworld.bmp" for now) to smooth the region's edges
|
--use these macros (mapped to "overworld.bmp" for now) to smooth the region's edges
|
||||||
function mapMaker.SmoothEdgesSimple(r)
|
function mapMaker.SmoothEdgesSimple(r)
|
||||||
--make and pad an array to use
|
--make and pad an array to use
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ createTrigger("door 1", overworld, 128, -128, function(entity)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local x, y = characterAPI.GetOrigin(entity)
|
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)
|
characterAPI.SetOrigin(entity, 0, 0)
|
||||||
networkAPI.PumpCharacterUpdate(entity)
|
networkAPI.PumpCharacterUpdate(entity)
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#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
|
//NOTE: type-dependant calls to various API functions, see bug #43
|
||||||
|
|
||||||
//reverse engineer the character index
|
//reverse engineer the character index
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
//TODO: (0) state-system for preventing double triggering
|
||||||
class TriggerData {
|
class TriggerData {
|
||||||
public:
|
public:
|
||||||
TriggerData() = default;
|
TriggerData() = default;
|
||||||
|
|||||||
Reference in New Issue
Block a user