summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-20 21:57:33 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-20 21:57:33 +0000
commit95acae21f2c3d1f76109f6d9c5a8121f1474a923 (patch)
treecdb6dc410692d5d299e91f81ca8f289c59725c4c /src/common/socket.c
parent131e693e935468ab8d247c9f4483851b51c25c28 (diff)
downloadhercules-95acae21f2c3d1f76109f6d9c5a8121f1474a923.tar.gz
hercules-95acae21f2c3d1f76109f6d9c5a8121f1474a923.tar.bz2
hercules-95acae21f2c3d1f76109f6d9c5a8121f1474a923.tar.xz
hercules-95acae21f2c3d1f76109f6d9c5a8121f1474a923.zip
- Added ntows() to properly handle that client port number deficiency
- Adjusted the packet_db array for a more consistent look - Reorganized some entries in packet_db.txt - Fixed a small scripts_custom.conf typo git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10296 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index f8bdcdc7a..f406a0eea 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1117,3 +1117,10 @@ uint32 str2ip(const char* ip_str)
{
return ntohl(inet_addr(ip_str));
}
+
+// Reorders bytes from network to little endian (Windows).
+// Neccessary for sending port numbers to the RO client until Gravity notices that they forgot ntohs() calls.
+uint16 ntows(uint16 neshort)
+{
+ return ((neshort & 0xFF) << 8) | ((neshort & 0xFF00) >> 8);
+}