Mirage Source
Saving some Bytes - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Saving some Bytes (/showthread.php?tid=1295)



Saving some Bytes - William - 19-09-2007

The best way would be to use a
Code:
Public Enum
for all of the packet names, but this is just a simple thing to do for playermove and npcmove, since those packets are sent the most.

Replace all of the finds.
Server Side
Find "playermove"
Replace it with "P"

Find "npcmove"
Replace it with "N"

Client Side
Find "playermove"
Replace it with "p"

Find "npcmove"
Replace it with "n"

Example for the Enum:
Code:
Public Enum ServerToClient
  StCPlayerMove = 0
  StCVerify '"verify"
  StCGuildInfo '"guildinfo"
  StCQuestMsg '"QuestMsg"
  StCLag ' "lag"
  StCFriendList ' "friendlist"
  StCDamageDisplay ' "damagedisplay"
  StCItemWorn '"itemworn"
  StCSendWing '"sendwing"
  StCMapMsg2 '"mapmsg2"
  StCShowLabelOnShop '"showlabelonshop"
  StCServerResults' "serverresults"
End Enum
I just started doing this.