本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadInt16方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadInt16方法的具体用法?C# NetIncomingMessage.ReadInt16怎么用?C# NetIncomingMessage.ReadInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
public void Decode(NetIncomingMessage im)
{
this.BlockID = im.ReadByte();
this.X = im.ReadInt16();
this.Y = im.ReadInt16();
this.Z = im.ReadByte();
}
示例2: Decode
public void Decode(NetIncomingMessage im)
{
this.ServerName = im.ReadString();
this.Description = im.ReadString();
this.Intro = im.ReadString();
this.Online = im.ReadByte();
int roomsLength = im.ReadByte();
for (int i = 0; i < roomsLength; i++)
{
Rooms.Add(new LobbySaveData(im.ReadString(), im.ReadInt16(), im.ReadString(), im.ReadByte(), im.ReadInt16(), im.ReadDouble()));
}
}
示例3: ClientDisconnectedTransferableData
public ClientDisconnectedTransferableData(NetIncomingMessage message)
{
SessionID = message.ReadInt64();
ID = message.ReadInt32();
IsValid = message.ReadBoolean();
PlayerIndex = message.ReadInt16();
}
开发者ID:elefantstudio-se,项目名称:xna-lidgren-multiplayer-game,代码行数:7,代码来源:ClientDisconnectedTransferableData.cs
示例4: ToOtherPlayers
public static void ToOtherPlayers(NetIncomingMessage im, OtherPlayer[] d)
{
bool alive = im.ReadBoolean();
float xp = im.ReadFloat();
float yp = im.ReadFloat();
float zp = im.ReadFloat();
Int32 id = im.ReadInt32();
float xr = im.ReadFloat();
float yr = im.ReadFloat();
Int16 model = im.ReadInt16();
if (d[id] == null)
{
d[id] = new OtherPlayer(xp, yp, zp, id, model, xr, yr);
}
d[id].model = model;
d[id].xr = xr;
d[id].yr = yr;
if (!alive)
{
d[id].ChangeLifeStatus(false);
}
d[id].position = new Vector3(xp, yp, zp);
d[id].boundingSphere.Center = new Vector3(d[id].position.X, d[id].position.Y + Constants.HEADMAX/2, d[id].position.Z);
}
示例5: ResLogin
public virtual S2C.Message.ResLogin ResLogin(NetIncomingMessage im)
{
Message.ResLogin data = new Message.ResLogin();
data.ret = im.ReadInt16();
if(OnResLogin != null) OnResLogin(im, data);
return data;
}
示例6: Decode
public void Decode(NetIncomingMessage im)
{
this.Username = im.ReadString();
this.Password = im.ReadString();
this.Color = ColorExtensions.ColorFromHSV(im.ReadInt16(), Client.IO.ColorSaturation / 255f, Client.IO.ColorValue / 255f);
if (Username.Length > Settings.MaxNameLength) //Clamp name length
Username = Username.Truncate(Settings.MaxNameLength);
}
示例7: ResSendAll
public virtual S2C.Message.ResSendAll ResSendAll(NetIncomingMessage im)
{
Message.ResSendAll data = new Message.ResSendAll();
data.ret = im.ReadInt16();
data.ret_message = im.ReadString();
if(OnResSendAll != null) OnResSendAll(im, data);
return data;
}
示例8: PlayerTransferableData
public PlayerTransferableData(NetIncomingMessage message)
{
SessionID = message.ReadInt64();
ID = message.ReadInt32();
Index = message.ReadInt16();
Position = message.ReadVector2();
Angle = message.ReadFloat();
IsValid = message.ReadBoolean();
}
示例9: Read
protected override void Read(NetIncomingMessage message)
{
var length = message.ReadUInt16();
Program = new short[length];
for (var i = 0; i < length; i++)
{
Program[i] = message.ReadInt16();
}
}
示例10: Decode
public override void Decode(NetIncomingMessage msg)
{
int temp = msg.ReadInt32();
if (temp > teamScores[player.TeamOf()])
teamScores[this.player.TeamOf()] = temp;
temp = msg.ReadInt32();
TeamFinalTest LPuzzle = ((TeamFinalTest)Game1.pStates[Game1.localPlayer].puzzle);
if (LPuzzle.countUpdates < temp)
{
LPuzzle.countUpdates = temp;
LPuzzle.circleLarge.Location = new Point(msg.ReadInt16(), msg.ReadInt16());
LPuzzle.smallPosition = new Vector2(msg.ReadFloat(), msg.ReadFloat());
LPuzzle.largeDirection.X = msg.ReadFloat();
LPuzzle.largeDirection.Y = msg.ReadFloat();
LPuzzle.smallDirection.X = msg.ReadFloat();
LPuzzle.smallDirection.Y = msg.ReadFloat();
LPuzzle.scale = msg.ReadFloat();
}
}
示例11: ResSend
public virtual S2C.Message.ResSend ResSend(NetIncomingMessage im)
{
Message.ResSend data = new Message.ResSend();
data.ret = im.ReadInt16();
data.ret_message = im.ReadString();
data.to_id = im.ReadString();
if(OnResSend != null) OnResSend(im, data);
return data;
}
示例12: 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);
}
示例13: Decode
public void Decode(NetIncomingMessage im)
{
map.Width = Width = im.ReadInt16();
map.Height = Height= im.ReadInt16();
map.Tiles = new Tile[map.Width, map.Height, 2];
for (int z = 0; z < 2; z++)
{
for (int y = 0; y < map.Height; y++)
{
for (int x = 0; x < map.Width; x++)
{
if (z == 0)
map.Tiles[x, y, 1] = new Tile(BlockType.FromID(im.ReadByte()));
else
map.Tiles[x, y, 0] = new Tile(BlockType.FromID(im.ReadByte()));
}
}
}
}
示例14: MsgToOtherPlayers
public static OtherPlayer MsgToOtherPlayers(NetIncomingMessage im)
{
bool alive = im.ReadBoolean();
float xp = im.ReadFloat();
float yp = im.ReadFloat();
float zp = im.ReadFloat();
Int32 id = im.ReadInt32();
float xr = im.ReadFloat();
float yr = im.ReadFloat();
Int16 model = im.ReadInt16();
OtherPlayer d = new OtherPlayer(xp, yp, zp, id, xr, yr, false);
d.model = model;
return d;
}
示例15: Decode
public void Decode(NetIncomingMessage im)
{
map.Width = im.ReadInt16();
map.Height = im.ReadInt16();
map.Tiles = new Tile[map.Width, map.Height, 2];
map.Minimap = new Minimap(map, map.Width, map.Height);
map.Minimap.Position = new Microsoft.Xna.Framework.Vector2(16, 16);
for (int z = 0; z < 2; z++)
{
for (int y = 0; y < map.Height; y++)
{
byte[] b = im.ReadBytes(map.Width);
for (int x = 0; x < map.Width; x++)
{
if (z == 0)
map.Tiles[x, y, 1] = new Tile(BlockType.BlockList[b[x]]);
else
map.Tiles[x, y, 0] = new Tile(BlockType.BlockList[b[x]]);
}
}
}
}