本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadVector3方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadVector3方法的具体用法?C# NetIncomingMessage.ReadVector3怎么用?C# NetIncomingMessage.ReadVector3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lidgren.Network.NetIncomingMessage
的用法示例。
在下文中一共展示了NetIncomingMessage.ReadVector3方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt32();
this.MessageTime = im.ReadDouble();
this.Position = im.ReadVector3();
/*this.MoveUp = im.ReadBoolean();
this.MoveDown = im.ReadBoolean();
this.MoveLeft = im.ReadBoolean();
this.MoveRight = im.ReadBoolean();*/
this.Object = Utility.Serializer.DeserializeObjectFromString<Model.Object.Object>(im.ReadString());
}
示例2: 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();
}
示例3: Decode
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt32();
this.MessageTime = im.ReadDouble();
this.RegionId = im.ReadInt32();
//this.Chunk = Utility.Serializer.DeserializeObjectFromString<Model.Map.Chunk.Chunk>(im.ReadString());
//this.Chunk.Parent = Model.Map.World.World.world.getRegion(this.RegionId);
//this.Chunk.setAllNeighboursOfBlocks();
this.Position = im.ReadVector3();
Model.Map.Chunk.Chunk var_Chunk = Model.Map.World.World.world.getChunkAtPosition(Position);
if (var_Chunk != null)
{
if (var_Chunk.IsRequested)
{
var_Chunk.IsRequested = false;
}
}
}
示例4: Decode
public void Decode(NetIncomingMessage im)
{
this.MessageTime = im.ReadDouble();
this.ChunkId = im.ReadInt32();
Microsoft.Xna.Framework.Vector3 var_Position = im.ReadVector3();
this.Block = GameLibrary.Model.Map.World.World.world.getBlockAtCoordinate(var_Position);
int var_Size = Enum.GetValues(typeof(GameLibrary.Model.Map.Block.BlockLayerEnum)).Length;
if (this.Block != null)
{
if (this.Block.IsRequested)
{
for (int i = 0; i < var_Size; i++)
{
this.Block.Layer[i] = (Model.Map.Block.BlockEnum)im.ReadInt32();
}
}
this.Block.IsRequested = false;
}
}
示例5: Decode
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt32();
this.MessageTime = im.ReadDouble();
this.Position = im.ReadVector3();
this.Velocity = im.ReadVector3();
this.MoveUp = im.ReadBoolean();
this.MoveDown = im.ReadBoolean();
this.MoveLeft = im.ReadBoolean();
this.MoveRight = im.ReadBoolean();
}
示例6: Update
public void Update()
{
// Recieve messages from the server.
while ((_msgBuffer = _client.ReadMessage()) != null)
{
NetIncomingMessageType msgType = _msgBuffer.MessageType;
switch (msgType)
{
case NetIncomingMessageType.StatusChanged:
{
NetConnectionStatus status = (NetConnectionStatus)_msgBuffer.ReadByte();
if (status == NetConnectionStatus.Disconnected)
{
string reason = _msgBuffer.ReadString();
switch (reason)
{
case "kicked":
{
_pbag.GameManager.SetErrorState(ErrorMsg.Kicked);
break;
}
case "banned":
{
_pbag.GameManager.SetErrorState(ErrorMsg.Banned);
break;
}
case "serverfull":
{
_pbag.GameManager.SetErrorState(ErrorMsg.ServerFull);
break;
}
case "versionmismatch":
{
_pbag.GameManager.SetErrorState(ErrorMsg.VersionMismatch);
break;
}
case "shutdown":
{
_pbag.GameManager.SetErrorState(ErrorMsg.ServerShutdown);
break;
}
case "restart":
{
_pbag.GameManager.SetErrorState(ErrorMsg.ServerRestart);
break;
}
case "exit":
{
//Todo need to find more info about this case in the disconnect switch
break;
}
default:
{
_pbag.GameManager.Temperrormsg(reason);
//Pbag.GameManager.SetErrorState(ErrorMsg.Unkown);
break;
}
}
}
break;
}
case NetIncomingMessageType.DiscoveryResponse:
{
string name = _msgBuffer.ReadString();
int playercount = _msgBuffer.ReadInt32();
int playermax = _msgBuffer.ReadInt32();
bool lan = _msgBuffer.ReadBoolean();
string ip = _msgBuffer.SenderEndpoint.Address.ToString();
ServerInformation newserver = new ServerInformation(name,ip,playercount,playermax,lan);
_pbag.GameManager.AddServer(newserver);
break;
}
case NetIncomingMessageType.ConnectionApproval:
{
break;
}
case NetIncomingMessageType.Data:
{
PacketType dataType = (PacketType)_msgBuffer.ReadByte();
switch (dataType)
{
case PacketType.WorldMapSize:
{
_pbag.WorldManager.Mapsize = _msgBuffer.ReadInt32();
_pbag.WorldManager.Start();
break;
}
case PacketType.PlayerInitialUpdate:
{
_pbag.Player.Myid = _msgBuffer.ReadInt32();
_pbag.Player.Name = _msgBuffer.ReadString();
_pbag.Player.Position = _msgBuffer.ReadVector3();
break;
}
case PacketType.PlayerJoined:
{
ClientPlayer dummy = new ClientPlayer(_pbag.GameManager.Conmanager);
dummy.Id = _msgBuffer.ReadInt32();
//.........这里部分代码省略.........
示例7: Decode
public void Decode(NetIncomingMessage im)
{
this.MessageTime = im.ReadDouble();
this.Position = im.ReadVector3();
}