mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-22 20:57:47 +00:00
Lua Parameter type 0 is now signed int. Type 1 in unsigned int. ShopSalesman script uses signed.
This commit is contained in:
parent
45b9f9a064
commit
fe69f069ea
3 changed files with 26 additions and 15 deletions
|
@ -192,6 +192,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
//Update Position
|
||||
case 0x00CA:
|
||||
//Update Position
|
||||
//subpacket.debugPrintSubPacket();
|
||||
UpdatePlayerPositionPacket posUpdate = new UpdatePlayerPositionPacket(subpacket.data);
|
||||
player.updatePlayerActorPosition(posUpdate.x, posUpdate.y, posUpdate.z, posUpdate.rot, posUpdate.moveState);
|
||||
|
||||
|
|
|
@ -75,6 +75,19 @@ namespace FFXIVClassic_Lobby_Server.common
|
|||
((input << 24) & 0xff000000);
|
||||
}
|
||||
|
||||
public static int swapEndian(int input)
|
||||
{
|
||||
uint inputAsUint = (uint)input;
|
||||
|
||||
input = (int)
|
||||
(((inputAsUint >> 24) & 0xff) |
|
||||
((inputAsUint << 8) & 0xff0000) |
|
||||
((inputAsUint >> 8) & 0xff00) |
|
||||
((inputAsUint << 24) & 0xff000000));
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public static uint MurmurHash2(string key, uint seed)
|
||||
{
|
||||
// 'm' and 'r' are mixing constants generated offline.
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace FFXIVClassic_Map_Server
|
|||
switch (code)
|
||||
{
|
||||
case 0x0: //Int32
|
||||
value = Utils.swapEndian(reader.ReadUInt32());
|
||||
value = Utils.swapEndian(reader.ReadInt32());
|
||||
break;
|
||||
case 0x1: //Int32
|
||||
value = Utils.swapEndian(reader.ReadUInt32());
|
||||
|
@ -86,11 +86,8 @@ namespace FFXIVClassic_Map_Server
|
|||
writer.Write((Byte)l.typeID);
|
||||
switch (l.typeID)
|
||||
{
|
||||
case 0x0: //Int32
|
||||
if (l.value is uint)
|
||||
writer.Write((UInt32)Utils.swapEndian((UInt32)l.value));
|
||||
else
|
||||
writer.Write((UInt32)Utils.swapEndian((UInt32)(Int32)l.value));
|
||||
case 0x0: //Int32
|
||||
writer.Write((Int32)Utils.swapEndian((Int32)l.value));
|
||||
break;
|
||||
case 0x1: //Int32
|
||||
writer.Write((UInt32)Utils.swapEndian((UInt32)l.value));
|
||||
|
@ -139,7 +136,7 @@ namespace FFXIVClassic_Map_Server
|
|||
switch (code)
|
||||
{
|
||||
case 0x0: //Int32
|
||||
value = Utils.swapEndian(reader.ReadUInt32());
|
||||
value = Utils.swapEndian(reader.ReadInt32());
|
||||
break;
|
||||
case 0x1: //Int32
|
||||
value = Utils.swapEndian(reader.ReadUInt32());
|
||||
|
@ -231,11 +228,11 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
if (d.Type == DataType.Number)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x0, (uint)d.Number));
|
||||
luaParams.Add(new LuaParam(0x0, (int)d.Number));
|
||||
}
|
||||
else if (d.Type == DataType.Number)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x0, (int)d.Number));
|
||||
luaParams.Add(new LuaParam(0x1, (uint)d.Number));
|
||||
}
|
||||
else if (d.Type == DataType.String)
|
||||
{
|
||||
|
@ -260,13 +257,13 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
private static void addToList(object o, List<LuaParam> luaParams)
|
||||
{
|
||||
if (o is uint)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x0, (uint)o));
|
||||
}
|
||||
else if (o is int)
|
||||
if (o is int)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x0, (int)o));
|
||||
}
|
||||
else if (o is uint)
|
||||
{
|
||||
luaParams.Add(new LuaParam(0x1, (uint)o));
|
||||
}
|
||||
else if (o is double)
|
||||
{
|
||||
|
@ -316,7 +313,7 @@ namespace FFXIVClassic_Map_Server
|
|||
switch (lParams[i].typeID)
|
||||
{
|
||||
case 0x0: //Int32
|
||||
dumpString += String.Format("0x{0:X}", (uint)lParams[i].value);
|
||||
dumpString += String.Format("0x{0:X}", (int)lParams[i].value);
|
||||
break;
|
||||
case 0x1: //Int32
|
||||
dumpString += String.Format("0x{0:X}", (uint)lParams[i].value);
|
||||
|
|
Loading…
Add table
Reference in a new issue