diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-15 17:13:04 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-15 17:13:04 +0000 |
commit | c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead (patch) | |
tree | b55395038c48dc99235e7385fbd43df5645e464a /src/map/clif.c | |
parent | 86b35597e549392cf2db3974fc140a50e021b5a0 (diff) | |
download | hercules-c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead.tar.gz hercules-c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead.tar.bz2 hercules-c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead.tar.xz hercules-c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead.zip |
* Some serious code cleanups
- adjusted @reloadbattleconf to not depend on variable ordering
- changed all battle vars to 'int' (removes pointless duplicit coding)
- added min, max and default columns to battle config data structure
- added properly bounded values for these columns (or at least tried to)
- battle-conf loading will now complain if it finds unknown settings,
and will reject values that are outside of the allowed range
- added CHATROOM_TITLE_SIZE and CHATROOM_PASS_SIZE
- partially cleaned up chatroom manipulation code
* Fixed 'Job_Professer' typo in mage jobchange quest
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11017 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 2c54e0787..30646a5b3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9236,11 +9236,22 @@ void clif_parse_ChatAddMember(int fd,struct map_session_data *sd) } /*========================================== - * + * S 00de <len>.w <limit>.w <pub>.B <passwd>.8B <title>.?B *------------------------------------------*/ -void clif_parse_ChatRoomStatusChange(int fd,struct map_session_data *sd) +void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) { - chat_changechatstatus(sd,RFIFOW(fd,4),RFIFOB(fd,6),(char*)RFIFOP(fd,7),(char*)RFIFOP(fd,15),RFIFOW(fd,2)-15); + int len = RFIFOW(fd,2)-15; + int limit = RFIFOW(fd,4); + bool public = (bool)RFIFOB(fd,6); + const char* password = (char*)RFIFOP(fd,7); //not zero-terminated + const char* title = (char*)RFIFOP(fd,15); // not zero-terminated + + char s_title[CHATROOM_TITLE_SIZE]; + char s_password[CHATROOM_PASS_SIZE]; + safestrncpy(s_title, title, min(len+1,CHATROOM_TITLE_SIZE)); + safestrncpy(s_password, password, CHATROOM_PASS_SIZE); + + chat_changechatstatus(sd, s_title, s_password, limit, public); } /*========================================== |