本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadUInt32方法的具体用法?C# NetIncomingMessage.ReadUInt32怎么用?C# NetIncomingMessage.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: R
public void R(NetIncomingMessage im)
{
Operat = im.ReadByte();
UserId = im.ReadUInt32();
if (Operat == Add || Operat == Changed)
{
Tag = im.ReadUInt32();
if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.POSITION_TAG))
{
X = im.ReadFloat();
Y = im.ReadFloat();
}
if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.RADIUS_TAG))
{
Radius = im.ReadInt32();
}
if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.COLOR_TAG))
{
Color = im.ReadUInt32();
}
if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.NAME_TAG))
{
Name = im.ReadString();
}
}
}
示例2: R
public void R(NetIncomingMessage im)
{
Uid = im.ReadUInt32();
X = im.ReadInt32();
Y = im.ReadInt32();
SpriteId = im.ReadUInt32();
}
示例3: DataReceived
public override void DataReceived ( NetCommand command, NetIncomingMessage msg )
{
if (command==NetCommand.Snapshot) {
var frame = msg.ReadUInt32();
var prevFrame = msg.ReadUInt32();
var ackCmdID = msg.ReadUInt32();
var serverTicks = msg.ReadInt64();
var size = msg.ReadInt32();
//Log.Warning("{0}", offsetTicks );
if (prevFrame!=0) {
Log.Warning("Bad initial snapshot. Previous frame does not equal zero.");
return;
}
if (ackCmdID!=0) {
Log.Warning("Bad command ID {0}. Command ID for initial snapshot must be zero.", ackCmdID);
return;
}
// read snapshot :
var snapshot = NetDeflate.Decompress( msg.ReadBytes(size) );
// initial snapshot contains atom table :
gameClient.Atoms = new AtomCollection( msg );
gameClient.SetState( new Active( gameClient, frame, snapshot, serverTicks ) );
}
if (command==NetCommand.Notification) {
gameClient.FeedNotification( msg.ReadString() );
}
}
示例4: R
public void R(NetIncomingMessage im)
{
Operat = im.ReadByte();
BallId = im.ReadUInt32();
if(Operat == Add)
{
X = im.ReadFloat();
Y = im.ReadFloat();
Radius = im.ReadInt32();
Color = im.ReadUInt32();
}
}
示例5: R
public void R(NetIncomingMessage im)
{
int Count = im.ReadInt32();
for(int i = 0; i < Count; ++i)
{
uint uid = im.ReadUInt32();
float x = im.ReadFloat();
float y = im.ReadFloat();
int r = im.ReadInt32();
uint color = im.ReadUInt32();
FixedList.Add(Tuple.Create<uint, float, float, int, uint>(uid, x, y, r, color));
}
}
示例6: ReadDelta
public static GameStateDelta ReadDelta(NetIncomingMessage message)
{
uint sequence = message.ReadUInt32();
uint fromSequence = message.ReadUInt32();
int length = message.ReadInt32();
byte[] bytes;
message.ReadBytes(length, out bytes);
var delta = new GameStateDelta(bytes);
delta.Sequence = sequence;
delta.FromSequence = fromSequence;
return delta;
}
示例7: R
public void R(NetIncomingMessage im)
{
int Count = im.ReadInt32();
for (int i = 0; i < Count; ++i)
{
uint uid = im.ReadUInt32();
float x = im.ReadFloat();
float y = im.ReadFloat();
int r = im.ReadInt32();
uint color = im.ReadUInt32();
string name = im.ReadString();
PLayerList.Add(Tuple.Create<uint, float, float, int, uint, string>(uid, x, y, r, color, name));
}
}
示例8: ReadPayload
public override void ReadPayload(NetIncomingMessage message)
{
base.ReadPayload(message);
Image = message.ReadBytes(message.ReadInt32());
Number = message.ReadUInt32();
SendIndex = message.ReadInt32();
}
示例9: ReadPayload
public override void ReadPayload(NetIncomingMessage message)
{
base.ReadPayload(message);
Region = new Rectangle(message.ReadInt32(), message.ReadInt32(), message.ReadInt32(), message.ReadInt32());
Number = message.ReadUInt32();
FinalLength = message.ReadInt32();
}
示例10: Write
/// <summary>
/// Writes a <see cref="NetIncomingMessage"/> buffer into the BitStream.
/// </summary>
/// <param name="source">The <see cref="NetIncomingMessage"/> who's contents will be copied to this BitStream.</param>
public void Write(NetIncomingMessage source)
{
#if DEBUG
var startBSPos = PositionBits;
var startMsgPos = (int)source.Position;
#endif
// Read full 32-bit integers
while (source.LengthBits - source.Position >= _bitsInt)
{
var v = source.ReadUInt32();
Write(v);
}
// Read full 8-bit integers
while (source.LengthBits - source.Position >= _bitsByte)
{
var v = source.ReadByte();
Write(v);
}
// Read the remaining bits
while (source.LengthBits > source.Position)
{
var v = source.ReadBoolean();
Write(v);
}
Debug.Assert(source.Position == source.LengthBits);
#if DEBUG
Debug.Assert(PositionBits - startBSPos == source.LengthBits - startMsgPos);
#endif
}
示例11: R
public void R(NetIncomingMessage im)
{
if(PlayerPack == null)
{
PlayerPack = new List<Tuple<uint, int, int, bool, uint>>();
}
int l = im.ReadInt32();
for(int i = 0; i < l; ++i)
{
var id = im.ReadUInt32();
var x = im.ReadInt32();
var y = im.ReadInt32();
var alive = im.ReadBoolean();
var sid = im.ReadUInt32();
PlayerPack.Add(Tuple.Create<uint, int, int, bool, uint>(id, x, y, alive, sid));
}
}
示例12: readBytes
public static void readBytes(NetIncomingMessage data, ClientSprite cs)
{
data.ReadByte();
cs.ID = data.ReadUInt32();
cs.SpriteID = (SpriteIDs)data.ReadUInt16();
cs.Position = new Microsoft.Xna.Framework.Vector2(data.ReadFloat(),data.ReadFloat());
cs.Rotation = data.ReadFloat();
}
示例13: ReceiveChunkData
public void ReceiveChunkData(NetIncomingMessage message)
{
for (int i = 0; i < Tiles.Length; ++i)
{
Tile tile = (Tile)message.ReadUInt32();
Tiles[i] = tile;
}
}
示例14: R
public void R(NetIncomingMessage im)
{
int Count = im.ReadInt32();
for(int i = 0; i < Count; ++i)
{
uint id = im.ReadUInt32();
int mark = im.ReadInt32();
MarkList.Add(new KeyValuePair<uint, int>(id, mark));
}
}
示例15: HandleEntityComponentNetworkMessage
/// <summary>
/// Handles an incoming entity component message
/// </summary>
/// <param name="message">Raw network message</param>
/// <returns>An IncomingEntityComponentMessage object</returns>
public IncomingEntityComponentMessage HandleEntityComponentNetworkMessage(NetIncomingMessage message)
{
var componentFamily = (ComponentFamily) message.ReadByte();
var messageParams = new List<object>();
while (message.Position < message.LengthBits)
{
switch ((NetworkDataType) message.ReadByte())
{
case NetworkDataType.d_enum:
messageParams.Add(message.ReadInt32());
break;
case NetworkDataType.d_bool:
messageParams.Add(message.ReadBoolean());
break;
case NetworkDataType.d_byte:
messageParams.Add(message.ReadByte());
break;
case NetworkDataType.d_sbyte:
messageParams.Add(message.ReadSByte());
break;
case NetworkDataType.d_ushort:
messageParams.Add(message.ReadUInt16());
break;
case NetworkDataType.d_short:
messageParams.Add(message.ReadInt16());
break;
case NetworkDataType.d_int:
messageParams.Add(message.ReadInt32());
break;
case NetworkDataType.d_uint:
messageParams.Add(message.ReadUInt32());
break;
case NetworkDataType.d_ulong:
messageParams.Add(message.ReadUInt64());
break;
case NetworkDataType.d_long:
messageParams.Add(message.ReadInt64());
break;
case NetworkDataType.d_float:
messageParams.Add(message.ReadFloat());
break;
case NetworkDataType.d_double:
messageParams.Add(message.ReadDouble());
break;
case NetworkDataType.d_string:
messageParams.Add(message.ReadString());
break;
case NetworkDataType.d_byteArray:
int length = message.ReadInt32();
messageParams.Add(message.ReadBytes(length));
break;
}
}
return new IncomingEntityComponentMessage(componentFamily, messageParams);
}