mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Added command and script packets. Finished the SetActorProperty packet. Fixed bug with manually send packets from console.
This commit is contained in:
parent
ba68546cc9
commit
0a6b005a0c
9 changed files with 198 additions and 43 deletions
|
@ -53,7 +53,70 @@ namespace FFXIVClassic_Lobby_Server.common
|
|||
DateTime unixEpoch = new DateTime(1970, 1, 1);
|
||||
unixTimeStamp = (UInt32)(zuluTime.Subtract(unixEpoch)).TotalSeconds;
|
||||
|
||||
return unixTimeStamp;
|
||||
return 0x55555555;
|
||||
//return unixTimeStamp;
|
||||
}
|
||||
|
||||
public static uint MurmurHash2(string key, uint seed)
|
||||
{
|
||||
// 'm' and 'r' are mixing constants generated offline.
|
||||
// They're not really 'magic', they just happen to work well.
|
||||
|
||||
byte[] data = Encoding.ASCII.GetBytes(key);
|
||||
const uint m = 0x5bd1e995;
|
||||
const int r = 24;
|
||||
int len = key.Length;
|
||||
int dataIndex = len - 4;
|
||||
|
||||
// Initialize the hash to a 'random' value
|
||||
|
||||
uint h = seed ^ (uint)len;
|
||||
|
||||
// Mix 4 bytes at a time into the hash
|
||||
|
||||
|
||||
while (len >= 4)
|
||||
{
|
||||
h *= m;
|
||||
|
||||
uint k = (uint)BitConverter.ToInt32(data, dataIndex);
|
||||
k = ((k >> 24) & 0xff) | // move byte 3 to byte 0
|
||||
((k << 8) & 0xff0000) | // move byte 1 to byte 2
|
||||
((k >> 8) & 0xff00) | // move byte 2 to byte 1
|
||||
((k << 24) & 0xff000000); // byte 0 to byte 3
|
||||
|
||||
k *= m;
|
||||
k ^= k >> r;
|
||||
k *= m;
|
||||
|
||||
h ^= k;
|
||||
|
||||
dataIndex -= 4;
|
||||
len -= 4;
|
||||
}
|
||||
|
||||
// Handle the last few bytes of the input array
|
||||
|
||||
switch (len)
|
||||
{
|
||||
case 3:
|
||||
h ^= (uint)data[2] << 16; goto case 2;
|
||||
case 2:
|
||||
h ^= (uint)data[0] << 8; goto case 1;
|
||||
case 1:
|
||||
h ^= data[1];
|
||||
h *= m;
|
||||
break;
|
||||
};
|
||||
|
||||
// Do a few final mixes of the hash to ensure the last few
|
||||
// bytes are well-incorporated.
|
||||
|
||||
h ^= h >> 13;
|
||||
h *= m;
|
||||
h ^= h >> 15;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue