diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-12-16 05:14:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-16 06:20:36 +0300 |
commit | 912bbffb23c385178b3d831b58deb76103bac322 (patch) | |
tree | 4fc0aa6d4c2da5629d9ee2258f5fe6887e997866 /src/map | |
parent | a0f8fc8cd4a4bd6e245848835db2775596b9362f (diff) | |
download | hercules-912bbffb23c385178b3d831b58deb76103bac322.tar.gz hercules-912bbffb23c385178b3d831b58deb76103bac322.tar.bz2 hercules-912bbffb23c385178b3d831b58deb76103bac322.tar.xz hercules-912bbffb23c385178b3d831b58deb76103bac322.zip |
Add packet CZ_CAMERA_INFO
This will allow use client command:
/viewpointvalue - show/hide camera information
/setcamera range rotation latitude - same with @camerainfo
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 16 | ||||
-rw-r--r-- | src/map/clif.h | 1 | ||||
-rw-r--r-- | src/map/packets.h | 5 | ||||
-rw-r--r-- | src/map/packets_struct.h | 11 |
4 files changed, 33 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e9c69257b..fd3c01168 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -22148,6 +22148,21 @@ static void clif_camera_change(struct map_session_data *sd, float range, float r #endif } +static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_cameraInfo(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20160525 + const struct PACKET_CZ_CAMERA_INFO *const p = RFIFOP(fd, 0); + char command[100]; + if (p->action == 1) { + sprintf(command, "%ccamerainfo", atcommand->at_symbol); + } else { + sprintf(command, "%ccamerainfo %15f %15f %15f", atcommand->at_symbol, p->range, p->rotation, p->latitude); + } + atcommand->exec(fd, sd, command, true); +#endif +} + // show item preview in already opened preview window static void clif_item_preview(struct map_session_data *sd, int n) { @@ -23361,6 +23376,7 @@ void clif_defaults(void) clif->camera_showWindow = clif_camera_showWindow; clif->camera_change = clif_camera_change; + clif->pCameraInfo = clif_parse_cameraInfo; clif->item_preview = clif_item_preview; clif->enchant_equipment = clif_enchant_equipment; diff --git a/src/map/clif.h b/src/map/clif.h index 568c312cf..170e9639d 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1583,6 +1583,7 @@ struct clif_interface { void (*pMemorialDungeonCommand) (int fd, struct map_session_data *sd); void (*camera_showWindow) (struct map_session_data *sd); void (*camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target); + void (*pCameraInfo) (int fd, struct map_session_data *sd); void (*item_preview) (struct map_session_data *sd, int n); bool (*enchant_equipment) (struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId); void (*pReqRemainTime) (int fd, struct map_session_data *sd); diff --git a/src/map/packets.h b/src/map/packets.h index 8e392cc63..81b861f78 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1789,6 +1789,11 @@ packet(0x96e,clif->ackmergeitems); // changed packet sizes #endif +// all 2016-05-25 +#if PACKETVER >= 20160525 + packet(0x0a77,clif->pCameraInfo); // CZ_CAMERA_INFO +#endif + // 2017-02-28aRagexeRE #if PACKETVER >= 20170228 // new packets diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 8fbe64e5f..95bf65b6d 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2907,6 +2907,17 @@ struct PACKET_ZC_CAMERA_INFO { DEFINE_PACKET_HEADER(ZC_CAMERA_INFO, 0x0a78); #endif +#if PACKETVER >= 20160525 +struct PACKET_CZ_CAMERA_INFO { + int16 packetType; + int8 action; + float range; + float rotation; + float latitude; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_CAMERA_INFO, 0x0a77); +#endif + #if PACKETVER_MAIN_NUM >= 20181128 || PACKETVER_RE_NUM >= 20181031 // PACKET_ZC_AUTOSPELLLIST2 struct PACKET_ZC_AUTOSPELLLIST { |