summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-26 11:25:12 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-26 11:25:12 +0000
commit80ce7898584ef58f01470fc8969bddfca47a2629 (patch)
tree59cf80a9ad715d11ec4457951bf1b555ca4b1f4a
parent59464c97011417a3535a2a614365211c124bf62e (diff)
downloadhercules-80ce7898584ef58f01470fc8969bddfca47a2629.tar.gz
hercules-80ce7898584ef58f01470fc8969bddfca47a2629.tar.bz2
hercules-80ce7898584ef58f01470fc8969bddfca47a2629.tar.xz
hercules-80ce7898584ef58f01470fc8969bddfca47a2629.zip
Increased the allowed packet size for chat messages.
Changed the capacity of the message column in chatlog (see sql update). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12725 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--sql-files/upgrade_svn12725.sql1
-rw-r--r--src/map/clif.c11
-rw-r--r--src/map/map.h2
4 files changed, 11 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 25a0c0585..c6f705e31 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,9 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2008/05/26
+ * Increased the allowed packet size for chat messages [ultramage]
+ - changed the capacity of the message column in chatlog (see sql update)
2008/05/25
* Increased storage space to 600 [Playtester]
2008/05/24
diff --git a/sql-files/upgrade_svn12725.sql b/sql-files/upgrade_svn12725.sql
new file mode 100644
index 000000000..bccdca61b
--- /dev/null
+++ b/sql-files/upgrade_svn12725.sql
@@ -0,0 +1 @@
+ALTER TABLE `chatlog` CHANGE `message` `message` VARCHAR( 255 ) NOT NULL
diff --git a/src/map/clif.c b/src/map/clif.c
index 05e71fe19..663ef51ea 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7570,12 +7570,13 @@ static bool clif_process_message(struct map_session_data* sd, int format, char**
ShowWarning("clif_process_message: Player '%s' sent an unterminated message string!\n", sd->status.name);
return false;
}
- if( messagelen > CHAT_SIZE_MAX )
+ if( messagelen > CHAT_SIZE_MAX-1 )
{ // messages mustn't be too long
- // Normally you can only enter CHATBOX_SIZE-1 chars into the chat box, but Frost Joke / Dazzler's text can be longer.
- // Neither the official client nor server place any restriction on the length of the text in the packet,
- // but we'll only allow reasonably long strings here. This also makes sure all strings fit into the `chatlog` table.
- ShowWarning("clif_process_message: Player '%s' sent a message too long ('%.*s')!\n", sd->status.name, CHAT_SIZE_MAX, message);
+ // Normally you can only enter CHATBOX_SIZE-1 letters into the chat box, but Frost Joke / Dazzler's text can be longer.
+ // Also, the physical size of strings that use multibyte encoding can go multiple times over the chatbox capacity.
+ // Neither the official client nor server place any restriction on the length of the data in the packet,
+ // but we'll only allow reasonably long strings here. This also makes sure that they fit into the `chatlog` table.
+ ShowWarning("clif_process_message: Player '%s' sent a message too long ('%.*s')!\n", sd->status.name, CHAT_SIZE_MAX-1, message);
return false;
}
diff --git a/src/map/map.h b/src/map/map.h
index c32951b45..954e211b9 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -151,7 +151,7 @@ enum {
#define CHATROOM_TITLE_SIZE (36 + 1)
#define CHATROOM_PASS_SIZE (8 + 1)
//Max allowed chat text length
-#define CHAT_SIZE_MAX 150
+#define CHAT_SIZE_MAX 256
#define DEFAULT_AUTOSAVE_INTERVAL 5*60*1000