1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

working time-of-day sending from server to client

This commit is contained in:
Perttu Ahola 2010-12-20 14:04:31 +02:00
parent ab7477c4c3
commit 5a36956f75
10 changed files with 198 additions and 148 deletions

View file

@ -20,6 +20,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef CLIENTSERVER_HEADER
#define CLIENTSERVER_HEADER
#include "utility.h"
#define PROTOCOL_ID 0x4f457403
enum ToClientCommand
@ -90,6 +92,12 @@ enum ToClientCommand
v3s16 blockpos
block objects
*/
TOCLIENT_TIME_OF_DAY = 0x29,
/*
u16 command
u16 time (0-23999)
*/
};
enum ToServerCommand
@ -185,8 +193,13 @@ enum ToServerCommand
*/
};
// Flags for TOSERVER_GETBLOCK
#define TOSERVER_GETBLOCK_FLAG_OPTIONAL (1<<0)
inline SharedBuffer<u8> makePacket_TOCLIENT_TIME_OF_DAY(u16 time)
{
SharedBuffer<u8> data(2+2);
writeU16(&data[0], TOCLIENT_TIME_OF_DAY);
writeU16(&data[2], time);
return data;
}
#endif