From e7beef1499ae660af01f163a16b9040bd60d8845 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Fri, 9 Mar 2007 01:49:50 +0000 Subject: - Added info on packet 0x86 (simple move packet). Not usable until a clear separation between entering sight/leaving sight/walking in sight is done. - Propagating const char* from the script engine. - ".gat" is appended to the map name before sending the changemapserver packet to the client. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9979 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 63 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 22 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 808733458..f7b018a31 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -113,7 +113,7 @@ static void clif_hpmeter_single(int fd, struct map_session_data *sd); * map鯖のip設定 *------------------------------------------ */ -int clif_setip(char *ip) +int clif_setip(const char* ip) { char ip_str[16]; map_ip = resolve_hostbyname(ip,NULL,ip_str); @@ -127,7 +127,7 @@ int clif_setip(char *ip) return 1; } -void clif_setbindip(char *ip) +void clif_setbindip(const char* ip) { unsigned char ip_str[4]; bind_ip = resolve_hostbyname(ip,ip_str,NULL); @@ -293,7 +293,7 @@ int clif_send_sub(struct block_list *bl, va_list ap) * *------------------------------------------ */ -int clif_send (unsigned char *buf, int len, struct block_list *bl, int type) { +int clif_send (const unsigned char *buf, int len, struct block_list *bl, int type) { int i; struct map_session_data *sd = NULL; struct party_data *p = NULL; @@ -1548,6 +1548,25 @@ int clif_movepc(struct map_session_data *sd) { return 0; } +/// Move the unit (does nothing if the client has no info about the unit) +/// Note: unit must not be self +//##TODO make sure insight/outsight code is solid enough before using this [FlavioJS] +/* +void clif_moveunit(int fd, struct unit_data* ud) +{ + struct block_list* bl; + + bl = ud->bl; + + WFIFOHEAD(fd, packet_len(0x86)); + WFIFOW(fd,0)=0x86; + WFIFOL(fd,2)=bl->id; + WFIFOPOS2(fd,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8); + WFIFOL(fd,12)=gettick(); + WFIFOSET(fd, packet_len(0x86)); +} +*/ + /*========================================== * *------------------------------------------ @@ -1685,7 +1704,7 @@ int clif_changemap(struct map_session_data *sd, short map, int x, int y) { * *------------------------------------------ */ -int clif_changemapserver(struct map_session_data *sd, char *mapname, int x, int y, int ip, int port) { +int clif_changemapserver(struct map_session_data* sd, const char* mapname, int x, int y, int ip, int port) { int fd; nullpo_retr(0, sd); @@ -1892,7 +1911,7 @@ void clif_sendfakenpc(struct map_session_data *sd, int npcid) { * *------------------------------------------ */ -int clif_scriptmenu(struct map_session_data *sd, int npcid, char *mes) { +int clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes) { int fd = sd->fd; int slen = strlen(mes) + 8; struct block_list *bl = NULL; @@ -1986,7 +2005,7 @@ int clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int * *------------------------------------------ */ -int clif_cutin(struct map_session_data *sd, char *image, int type) { +int clif_cutin(struct map_session_data* sd, const char* image, int type) { int fd; nullpo_retr(0, sd); @@ -3391,7 +3410,7 @@ int clif_leavechat(struct chat_data* cd,struct map_session_data *sd) * 取り引き要請受け *------------------------------------------ */ -int clif_traderequest(struct map_session_data *sd,char *name) +int clif_traderequest(struct map_session_data* sd, const char* name) { int fd; @@ -4864,7 +4883,7 @@ int clif_status_change(struct block_list *bl,int type,int flag) * Send message (modified by [Yor]) *------------------------------------------ */ -int clif_displaymessage(const int fd, char* mes) +int clif_displaymessage(const int fd, const char* mes) { // invalid pointer? nullpo_retr(-1, mes); @@ -4891,7 +4910,7 @@ int clif_displaymessage(const int fd, char* mes) * 天の声を送信する *------------------------------------------ */ -int clif_GMmessage(struct block_list *bl, char* mes, int len, int flag) +int clif_GMmessage(struct block_list* bl, const char* mes, int len, int flag) { unsigned char *buf; int lp; @@ -4921,7 +4940,7 @@ int clif_GMmessage(struct block_list *bl, char* mes, int len, int flag) * グローバルメッセージ *------------------------------------------ */ -void clif_GlobalMessage(struct block_list *bl,char *message) +void clif_GlobalMessage(struct block_list* bl, const char* message) { char buf[100]; int len; @@ -4944,7 +4963,7 @@ void clif_GlobalMessage(struct block_list *bl,char *message) * Send main chat message [LuzZza] *------------------------------------------ */ -void clif_MainChatMessage(char* message) { +void clif_MainChatMessage(const char* message) { char buf[200]; int len; @@ -4968,7 +4987,7 @@ void clif_MainChatMessage(char* message) { * Does an announce message in the given color. *------------------------------------------ */ -int clif_announce(struct block_list *bl, char* mes, int len, unsigned long color, int flag) +int clif_announce(struct block_list* bl, const char* mes, int len, unsigned long color, int flag) { unsigned char *buf; buf = (unsigned char*)aMallocA((len + 16)*sizeof(unsigned char)); @@ -5114,7 +5133,7 @@ int clif_refine(int fd,struct map_session_data *sd,int fail,int index,int val) * Wisp/page is transmitted to the destination player *------------------------------------------ */ -int clif_wis_message(int fd, char *nick, char *mes, int mes_len) // R 0097 .w .24B .?B +int clif_wis_message(int fd, const char* nick, const char* mes, int mes_len) // R 0097 .w .24B .?B { // printf("clif_wis_message(%d, %s, %s)\n", fd, nick, mes); @@ -5492,7 +5511,7 @@ int clif_openvendingreq(struct map_session_data *sd,int num) * 露店看板表示 *------------------------------------------ */ -int clif_showvendingboard(struct block_list* bl,char *message,int fd) +int clif_showvendingboard(struct block_list* bl, const char* message, int fd) { unsigned char buf[128]; @@ -5780,7 +5799,7 @@ int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd) * 4 -> char of the same account already joined the party *------------------------------------------ */ -int clif_party_inviteack(struct map_session_data *sd,char *nick,int flag) +int clif_party_inviteack(struct map_session_data* sd, const char* nick, int flag) { int fd; @@ -5829,7 +5848,7 @@ int clif_party_option(struct party_data *p,struct map_session_data *sd,int flag) * パーティ脱退(脱退前に呼ぶこと) *------------------------------------------ */ -int clif_party_leaved(struct party_data *p,struct map_session_data *sd,int account_id,char *name,int flag) +int clif_party_leaved(struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag) { unsigned char buf[64]; int i; @@ -5860,7 +5879,7 @@ int clif_party_leaved(struct party_data *p,struct map_session_data *sd,int accou * パーティメッセージ送信 *------------------------------------------ */ -int clif_party_message(struct party_data *p,int account_id,char *mes,int len) +int clif_party_message(struct party_data* p, int account_id, const char* mes, int len) { struct map_session_data *sd; int i; @@ -7207,7 +7226,7 @@ void clif_emotion(struct block_list *bl,int type) * トーキーボックス *------------------------------------------ */ -void clif_talkiebox(struct block_list *bl,char* talkie) +void clif_talkiebox(struct block_list* bl, const char* talkie) { unsigned char buf[86]; @@ -7292,7 +7311,7 @@ void clif_marriage_process(struct map_session_data *sd) * Notice of divorce *------------------------------------------ */ -void clif_divorced(struct map_session_data *sd, char *name) +void clif_divorced(struct map_session_data* sd, const char* name) { int fd; nullpo_retv(sd); @@ -7366,7 +7385,7 @@ int clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len) * Displays a message using the guild-chat colors to the specified targets. [Skotlex] *------------------------------------------ */ -void clif_disp_message(struct block_list *src, char *mes, int len, int type) +void clif_disp_message(struct block_list* src, const char* mes, int len, int type) { unsigned char buf[1024]; if (!len) return; @@ -7789,7 +7808,7 @@ int clif_slide(struct block_list *bl, int x, int y){ * @me command by lordalfa, rewritten implementation by Skotlex *------------------------------------------ */ -int clif_disp_overhead(struct map_session_data *sd, char* mes) +int clif_disp_overhead(struct map_session_data *sd, const char* mes) { unsigned char buf[256]; //This should be more than sufficient, the theorical max is CHAT_SIZE + 8 (pads and extra inserted crap) int len_mes = strlen(mes)+1; //Account for \0 @@ -8623,7 +8642,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) return; } -int clif_message(struct block_list *bl, char* msg) +int clif_message(struct block_list *bl, const char* msg) { unsigned short msg_len = strlen(msg) + 1; unsigned char buf[256]; -- cgit v1.2.3-70-g09d2