本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadInt32方法的具体用法?C# NetIncomingMessage.ReadInt32怎么用?C# NetIncomingMessage.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
public void Decode(NetIncomingMessage im)
{
this.Value = (ResultOfAttack) im.ReadInt32();
this.Text = im.ReadString();
this.Row = im.ReadInt32();
this.Col = im.ReadInt32();
}
示例2: 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();
}
示例3: R
public void R(NetIncomingMessage im)
{
Uid = im.ReadUInt32();
X = im.ReadInt32();
Y = im.ReadInt32();
SpriteId = im.ReadUInt32();
}
示例4: Decode
public void Decode(NetIncomingMessage im)
{
this.MessageTime = im.ReadDouble();
this.Id = im.ReadInt32();
this.OldPosition = im.ReadInt32();
this.NewPosition = im.ReadInt32();
}
示例5: Decode
public void Decode(NetIncomingMessage im)
{
this.MessageTime = im.ReadDouble();
this.Id = im.ReadInt32();
this.EquipmentPosition = im.ReadInt32();
this.InventoryPosition = im.ReadInt32();
}
示例6: ReadPayload
public override void ReadPayload(NetIncomingMessage message)
{
base.ReadPayload(message);
Image = message.ReadBytes(message.ReadInt32());
Number = message.ReadUInt32();
SendIndex = message.ReadInt32();
}
示例7: LoadTileMap
public bool LoadTileMap(NetIncomingMessage message)
{
int _mapWidth = message.ReadInt32();
int _mapHeight = message.ReadInt32();
_groundArray = new QuadTree<Tile>(new SizeF(2*TileSpacing, 2*TileSpacing), 4);
_wallArray = new QuadTree<Tile>(new SizeF(2 * TileSpacing, 2 * TileSpacing), 4);
while (message.PositionInBytes < message.LengthBytes)
{
float posX = message.ReadFloat();
float posY = message.ReadFloat();
byte index = message.ReadByte();
var state = (TileState)message.ReadByte();
string name = GetTileString(index);
Direction dir = Direction.North;
if (name == "Wall")
{
dir = (Direction)message.ReadByte();
}
Tile newTile = GenerateNewTile(GetTileString(index), state, new Vector2D(posX, posY), dir);
AddTile(newTile);
}
foreach (Wall w in GetAllWallIn(new RectangleF(0, 0, _mapWidth * TileSpacing, _mapHeight * TileSpacing)))
{
w.SetSprite();
}
_loaded = true;
return true;
}
示例8: Decode
public void Decode(NetIncomingMessage im)
{
Shots = im.ReadInt32();
Hits = im.ReadInt32();
Misses = im.ReadInt32();
ShipsKilled = im.ReadInt32();
}
示例9: HealthTransferableData
public HealthTransferableData(NetIncomingMessage message)
{
SessionID = message.ReadInt64();
ID = message.ReadInt32();
IsValid = message.ReadBoolean();
PlayerIndex = message.ReadInt32();
Value = message.ReadFloat();
}
示例10: 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));
}
}
示例11: 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);
}
示例12: PopulateFromMsg
public void PopulateFromMsg(NetIncomingMessage msg)
{
m_serverName = msg.ReadString();
m_serverType = (NetServerType)msg.ReadByte();
m_serverInternalAdress = msg.ReadIPEndPoint();
m_serverExternalAdress = msg.SenderEndPoint;
m_currentNbPlayers = msg.ReadInt32();
m_maxPlayers = msg.ReadInt32();
m_NATtoken = msg.ReadString();
m_lastContact = DateTime.Now;
}
示例13: Decode
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt32();
this.MessageTime = im.ReadDouble();
//this.Region = Utility.Serializer.DeserializeObjectFromString<Model.Map.Region.Region>(im.ReadString());
//this.Region.Parent = Model.Map.World.World.world;
this.Position = im.ReadVector3();
this.RegionEnum = (Model.Map.Region.RegionEnum)im.ReadInt32();
}
示例14: 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));
}
}
示例15: 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));
}
}