home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server: Decouple update_map_memory() and build_fov_map(), thus fix bugs.
[plomrogue]
/
src
/
server
/
io.c
diff --git
a/src/server/io.c
b/src/server/io.c
index 0cf2c056782aa2c56846580afb01676ec61f266d..227be3fd4e192a4886c29617771cc2637a245696 100644
(file)
--- a/
src/server/io.c
+++ b/
src/server/io.c
@@
-24,6
+24,7
@@
#include "../common/try_malloc.h" /* try_malloc() */
#include "cleanup.h" /* set_cleanup_flag() */
#include "hardcoded_strings.h" /* s */
#include "../common/try_malloc.h" /* try_malloc() */
#include "cleanup.h" /* set_cleanup_flag() */
#include "hardcoded_strings.h" /* s */
+#include "run.h" /* send_to_outfile() */
#include "things.h" /* Thing, ThingType, ThingInMemory, ThingAction,
* get_thing_type(), get_player()
*/
#include "things.h" /* Thing, ThingType, ThingInMemory, ThingAction,
* get_thing_type(), get_player()
*/
@@
-190,7
+191,7
@@
static void try_growing_queue()
dur.tv_nsec = 33333333;
while (1)
{
dur.tv_nsec = 33333333;
while (1)
{
- if (read_file_into_queue(world.file_in, &world.queue
,&world.queue_size
))
+ if (read_file_into_queue(world.file_in, &world.queue))
{
return;
}
{
return;
}
@@
-349,17
+350,18
@@
static void write_map(struct Thing * player, FILE * file)
extern char * io_round()
{
extern char * io_round()
{
- if (
0 < world.queue_size
)
+ if (
world.queue && strlen(world.queue)
)
{
{
- return get_message_from_queue(&world.queue
, &world.queue_size
);
+ return get_message_from_queue(&world.queue);
}
if (world.do_update)
{
update_worldstate_file();
}
if (world.do_update)
{
update_worldstate_file();
+ send_to_outfile("WORLD_UPDATED\n", 1);
world.do_update = 0;
}
try_growing_queue();
world.do_update = 0;
}
try_growing_queue();
- return get_message_from_queue(&world.queue
, &world.queue_size
);
+ return get_message_from_queue(&world.queue);
}
}