本文整理汇总了C#中PacketReader.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadUInt32方法的具体用法?C# PacketReader.ReadUInt32怎么用?C# PacketReader.ReadUInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginServerConnectFromCharServer
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void LoginServerConnectFromCharServer( NetState netState, PacketReader packetReader )
{
// 错误 不可能有创建
if ( netState.ExtendData is CharServerExtendData == true )
return;
else
netState.ExtendData = null;
if ( packetReader.Size < 14/*6 + 8 + ?*/ )
return;
// 不检查网络是否活动
netState.IsCheckActivity = false;
long l_iCharGUID = packetReader.ReadUInt32();
long l_iCharPort = packetReader.ReadUInt32();
string l_strLoginPassword = packetReader.ReadStringSafe();
if ( l_strLoginPassword == Program.ConfigInfo.LoginPassword )
{
CharServerExtendData l_ExtendData = new CharServerExtendData();
l_ExtendData.IsLoggedIn = true;
l_ExtendData.CharGUID = l_iCharGUID;
l_ExtendData.CharHost = netState.NetAddress.ToString();
l_ExtendData.CharPort = l_iCharPort;
netState.ExtendData = l_ExtendData;
Program.CharServerList.Add(l_ExtendData);
l_ExtendData.ConnectToCharServer( l_ExtendData.CharHost, l_ExtendData.CharPort );
}
}
示例2: OnCompressedGump
private static void OnCompressedGump(PacketReader p, PacketHandlerEventArgs e)
{
p.MoveToData();
uint sender = p.ReadUInt32();
uint id = p.ReadUInt32();
if (id == gumpID)
{
responseID = sender;
e.Block = enabled;
}
}
示例3: IS_NCI
/// <summary>
/// Creates a new IS_NCI class.
/// </summary>
/// <param name="buffer">The buffer containing the packet data.</param>
public IS_NCI(byte[] buffer):this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
UCID = reader.ReadByte();
Language = (LfsLanguage)reader.ReadByte();
reader.Skip(3);
UserID = reader.ReadUInt32();
IPAddress = new IPAddress(reader.ReadUInt32());
}
示例4: IS_SPX
/// <summary>
/// Creates a new split time packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_SPX(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
STime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
ETime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
Split = reader.ReadByte();
Penalty = (PenaltyValue)reader.ReadByte();
NumStops = reader.ReadByte();
}
示例5: IS_LAP
/// <summary>
/// Creates a new lap time packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_LAP(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
LTime = TimeSpan.FromMilliseconds(reader.ReadUInt32()); ;
ETime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
LapsDone = reader.ReadUInt16();
Flags = (PlayerFlags)reader.ReadUInt16();
reader.Skip(1);
Penalty = (PenaltyValue)reader.ReadByte();
NumStops = reader.ReadByte();
}
示例6: Realm_HandleRegisterRealmResult
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void Realm_HandleRegisterRealmResult( NetState netState, PacketReader packetReader )
{
RealmExtendData extendData = netState.GetComponent<RealmExtendData>( RealmExtendData.COMPONENT_ID );
if ( extendData == null )
{
Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRegisterRealmResult(...) - extendData == null error!" );
return;
}
if ( extendData.IsLoggedIn == true )
{
Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRegisterRealmResult(...) - extendData.IsLoggedIn == true error!" );
return;
}
uint iRealmSerial = packetReader.ReadUInt32();
extendData.RegisterRealmResult.Serial = new Serial( iRealmSerial );
// 已经登陆
extendData.IsLoggedIn = true;
// 3分钟 向服务端发一次心跳信号
TimeSlice.StartTimeSlice( TimerPriority.Lowest, TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimeSliceCallback( SendPing ) );
LOGs.WriteLine( LogMessageType.MSG_INFO, "RealmServer:登陆RealmServer服务器成功 返回的标示ID({0})", extendData.RegisterRealmResult.Serial.ToString() );
}
示例7: Menu
public Menu(byte[] data)
: base(data)
{
PacketReader reader = new PacketReader(data);
byte id = reader.ReadByte();
ushort blockSize = reader.ReadUInt16();
dialogSerial = reader.ReadUInt32();
menuSerial = reader.ReadUInt16();
byte titleLen = reader.ReadByte();
title = reader.ReadAnsiString(titleLen);
byte optionCount = reader.ReadByte();
MenuOption[] optionList = new MenuOption[optionCount];
for (int i = 0; i < optionCount; i++) {
optionList[i].Artwork = reader.ReadUInt16();
optionList[i].Hue = reader.ReadUInt16();
byte textLen = reader.ReadByte();
optionList[i].Text = reader.ReadAnsiString(textLen);
}
options = Array.AsReadOnly<MenuOption>(optionList);
// if (reader.Offset == reader.Length)
// System.Diagnostics.Debug.WriteLine("Menu packet resolved succesfully.", "Communication");
}
示例8: Realm_HandleRequestSession
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
public static void Realm_HandleRequestSession( NetState netState, PacketReader packetReader )
{
RealmExtendData extendData = netState.GetComponent<RealmExtendData>( RealmExtendData.COMPONENT_ID );
if ( extendData == null )
{
Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRequestSession(...) - extendData == null error!" );
return;
}
if ( extendData.IsLoggedIn == false )
{
Debug.WriteLine( "Realm_PacketHandlers.Realm_HandleRequestSession(...) - extendData.IsLoggedIn == false error!" );
return;
}
uint iSerial = packetReader.ReadUInt32();
string strAccountName = packetReader.ReadUTF8StringSafe();
WowAccount wowAccount = WowAccountHandler.GetAccount( strAccountName );
if ( wowAccount == null )
{
netState.Send( new Realm_RequestSessionResultError( iSerial ) );
return;
}
SecureRemotePassword srp = SrpHandler.GetSRP( strAccountName );
if ( srp == null )
{
netState.Send( new Realm_RequestSessionResultError( iSerial ) );
return;
}
netState.Send( new Realm_RequestSessionResult( iSerial, wowAccount, srp ) );
}
示例9: World_HandleRealmSplitStateRequest
/// <summary>
///
/// </summary>
/// <param name="netState"></param>
/// <param name="packetReader"></param>
internal static void World_HandleRealmSplitStateRequest( NetState netState, PacketReader packetReader )
{
LOGs.WriteLine( LogMessageType.MSG_HACK, "World_HandleRealmSplitStateRequest...... {0} ", packetReader.Size );
WorldExtendData extendData = netState.GetComponent<WorldExtendData>( WorldExtendData.COMPONENT_ID );
if ( extendData == null )
{
Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData == null error!" );
return;
}
if ( extendData.IsLoggedIn == false )
{
Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData.IsLoggedIn == false error!" );
return;
}
if ( packetReader.Size < 10 /*ProcessNet.WORLD_HEAD_SIZE + 0*/)
{
Debug.WriteLine( "World_PacketHandlers.World_HandleRealmSplitStateRequest(...) - extendData.Size < 10 error!" );
return;
}
uint iUnknown = packetReader.ReadUInt32();
netState.Send( new Word_RealmSplitStateRequest( iUnknown ) );
//netState.Send( new Word_CharEnumResponse( new WowCharacterInfo[0] ) );
}
示例10: HandlePacket
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var reader = new PacketReader(data, position, size);
var charId = reader.ReadUInt32();
if (context.User == null)
return;
if (context.Character == null) // On character create, this is already set.
{
using (var db = new PolarisEf())
{
var character = db.Characters.Find((int)charId);
if (character == null || character.Player.PlayerId != context.User.PlayerId)
return;
context.Character = character;
}
}
// Transition to the loading screen
context.SendPacket(new NoPayloadPacket(0x3, 0x4));
// TODO Set area, Set character, possibly more. See PolarisLegacy for more.
}
示例11: OnFilter
public override void OnFilter( PacketReader p, PacketHandlerEventArgs args )
{
if ( args.Block )
return;
// 0, 1, 2
Serial serial = p.ReadUInt32(); // 3, 4, 5, 6
ushort body = p.ReadUInt16(); // 7, 8
MessageType type = (MessageType)p.ReadByte(); // 9
if ( type != m_Type )
return;
ushort hue = p.ReadUInt16(); // 10, 11
ushort font = p.ReadUInt16();
string name = p.ReadStringSafe( 30 );
string text = p.ReadStringSafe();
for(int i=0;i<m_Strings.Length;i++)
{
if ( text.IndexOf( m_Strings[i] ) != -1 )
{
args.Block = true;
return;
}
}
}
示例12: IS_FIN
/// <summary>
/// Creates a new finished race notification packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_FIN(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
TTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
BTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
reader.Skip(1);
NumStops = reader.ReadByte();
Confirm = (ConfirmationFlags)reader.ReadByte();
reader.Skip(1);
LapsDone = reader.ReadUInt16();
Flags = (PlayerFlags)reader.ReadUInt16();
}
示例13: ReadPacket
public void ReadPacket(PacketReader reader)
{
MessageType = reader.ReadInt32();
Unknown1 = reader.ReadInt32();
ServerTick = reader.ReadUInt32();
Unknown2 = (byte)reader.ReadByte();
switch (MessageType) // not sure about this
{
case 1:
break;
case 2:
UserID = reader.ReadInt64();
UserID2 = reader.ReadInt64();
Username = reader.ReadString();
Unknown3 = reader.ReadInt32();
Unknown4 = reader.ReadInt32();
MemberStatus = (MemberStatusId)reader.ReadInt32();
MessageTime = TimeSpan.FromSeconds(reader.ReadInt32());
Message = reader.ReadString();
break;
default:
break;
}
}
示例14: OnFilter
public override void OnFilter( PacketReader p, PacketHandlerEventArgs args )
{
uint serial = p.ReadUInt32();
ushort itemID = p.ReadUInt16();
if ( (serial & 0x80000000) != 0 )
p.ReadUInt16(); // amount
if ( (itemID & 0x8000) != 0 )
itemID = (ushort)((itemID&0x7FFF) + p.ReadSByte()); // itemID offset
ushort x = p.ReadUInt16();
ushort y = p.ReadUInt16();
if ( (x & 0x8000) != 0 )
p.ReadByte(); // direction
short z = p.ReadSByte();
if ( ( y & 0x8000 ) != 0 )
p.ReadUInt16(); // hue
bool visable = true;
if ( ( y & 0x4000 ) != 0 )
{
int flags = p.ReadByte();
visable = ( (flags&0x80) == 0 );
}
if ( IsStaffItem( itemID ) || !visable )
args.Block = true;
}
示例15: IS_SMALL
/// <summary>
/// Creates a new general purpose packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_SMALL(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
SubT = (SmallType)reader.ReadByte();
UVal = reader.ReadUInt32();
}