View Single Post
  #1  
Old 10-19-2010, 10:42 AM
orkim
Sarnak
 
Join Date: Sep 2008
Location: -
Posts: 31
Default COMMITTED: Short Name Restriction Fixed

I took the time today to fixup the code so that we can go beyond the 16 character limit on the zone short_name fields. Attached is my diff.

Code:
Index: world/LauncherLink.cpp
===================================================================
--- world/LauncherLink.cpp      (revision 1708)
+++ world/LauncherLink.cpp      (working copy)
@@ -211,7 +211,7 @@
        ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneRequest, sizeof(LauncherZoneRequest));
        LauncherZoneRequest* s = (LauncherZoneRequest *) pack->pBuffer;

-       strn0cpy(s->short_name, short_name, 16);
+       strn0cpy(s->short_name, short_name, 32);
        s->command = ZR_Start;

        SendPacket(pack);
@@ -222,7 +222,7 @@
        ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneRequest, sizeof(LauncherZoneRequest));
        LauncherZoneRequest* s = (LauncherZoneRequest *) pack->pBuffer;

-       strn0cpy(s->short_name, short_name, 16);
+       strn0cpy(s->short_name, short_name, 32);
        s->command = ZR_Restart;

        SendPacket(pack);
@@ -233,7 +233,7 @@
        ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneRequest, sizeof(LauncherZoneRequest));
        LauncherZoneRequest* s = (LauncherZoneRequest *) pack->pBuffer;

-       strn0cpy(s->short_name, short_name, 16);
+       strn0cpy(s->short_name, short_name, 32);
        s->command = ZR_Stop;

        SendPacket(pack);
Index: common/servertalk.h
===================================================================
--- common/servertalk.h (revision 1708)
+++ common/servertalk.h (working copy)
@@ -690,11 +690,11 @@
 } ZoneRequestCommands;
 struct LauncherZoneRequest {
        uint8 command;
-       char short_name[17];
+       char short_name[33];
 };

 struct LauncherZoneStatus {
-       char short_name[17];
+       char short_name[33];
        uint32 start_count;
        uint8 running;
 };
Index: eqlaunch/worldserver.cpp
===================================================================
--- eqlaunch/worldserver.cpp    (revision 1708)
+++ eqlaunch/worldserver.cpp    (working copy)
@@ -140,7 +140,7 @@
        ServerPacket* pack = new ServerPacket(ServerOP_LauncherZoneStatus, sizeof(LauncherZoneStatus));
        LauncherZoneStatus* it =(LauncherZoneStatus*) pack->pBuffer;

-       strn0cpy(it->short_name, short_name, 16);
+       strn0cpy(it->short_name, short_name, 32);
        it->start_count = start_count;
        it->running = running?1:0;

Index: utils/schema.xml
===================================================================
--- utils/schema.xml    (revision 1708)
+++ utils/schema.xml    (working copy)
@@ -5240,7 +5240,7 @@
 </TABLE>
 <TABLE ID="4595" Tablename="zone" PrevTableName="" XPos="2018" YPos="1881" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=$
 <COLUMNS>
-<COLUMN ID="5706" ColName="short_name" PrevColName="" Pos="1" idDatatype="20" DatatypeParams="(16)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
+<COLUMN ID="5706" ColName="short_name" PrevColName="" Pos="1" idDatatype="20" DatatypeParams="(32)" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
 <OPTIONSELECTED>
 <OPTIONSELECT Value="0" />
 </OPTIONSELECTED>
After applying this code, update the database as follows:

Code:
ALTER TABLE `zone` CHANGE `short_name` `short_name` VARCHAR( 32 ) ;
UPDATE `zone` SET `short_name` = 'oceangreenvillage' WHERE `zone`.`id` = 261 LIMIT 1 ;
Start up the server, log in, a '#fz ocean' will list the full short name now. As well, a '#zone oceangreenvillage' (note, with the e on the end) is required to zone in.

-ork
Reply With Quote