public Write ( |
||
endPoint | ||
return | void |
public override void Encode(NetOutgoingMessage msg) { msg.Write(findSixes); msg.Write((byte)nPosition.Count); foreach (byte p in nPosition) msg.Write(p); }
public void SendMovementUpdate() { _outmsg = _client.CreateMessage(); _outmsg.Write((byte)PacketType.PlayerMovementUpdate); _outmsg.Write(_pbag.Player.Position); _client.SendMessage(_outmsg, NetDeliveryMethod.ReliableOrdered); }
public void WriteToMessage(NetOutgoingMessage message) { message.Write(SessionID); message.Write(ID); message.Write(IsValid); message.Write(PlayerIndex); }
public void Write(NetOutgoingMessage packet) { packet.Write(this.Slot); packet.Write((Byte)this.Team); packet.Write(this.Callsign); packet.Write(this.Tag); }
public static void ToNetMsg(string sender, string group, string message, ref NetOutgoingMessage netMsg) { netMsg.Write((byte)NetDataType.eDATA_GROUP_MSG); netMsg.Write(sender); netMsg.Write(group); netMsg.Write(message); }
public void Write(NetOutgoingMessage packet) { packet.Write(Slot); packet.Write((Byte)Team); packet.Write(Callsign); packet.Write(Tag); }
internal override void Write(NetOutgoingMessage Message) { base.Write(Message); Message.Write(Language.ToString()); Message.Write(Location.ToString()); Message.Write(Source); }
public void SendPlayerInWorld() { _outmsg = _client.CreateMessage(); _outmsg.Write((byte)PacketType.PlayerInWorld); _outmsg.Write(true); _client.SendMessage(_outmsg, NetDeliveryMethod.ReliableOrdered); }
protected override void Write(NetOutgoingMessage message) { message.Write(body.Position.X * Constants.PixelsPerMeter); message.Write(body.Position.Y * Constants.PixelsPerMeter); message.Write(body.Rotation.ToNetworkRotation()); message.Write(type); }
public void W(NetOutgoingMessage om) { om.Write(Uid); om.Write(X); om.Write(Y); om.Write(SpriteId); }
public static void ToNetMsg(long serverUUID, IPEndPoint clientInternal, string token, ref NetOutgoingMessage netMsg) { netMsg.Write((byte)NetDataType.eDATA_REQUEST_INTRODUCTION); netMsg.Write(serverUUID); netMsg.Write(clientInternal); netMsg.Write(token); }
public void Encode(NetOutgoingMessage om) { om.Write(this.MessageTime); om.Write(this.Id); om.Write(this.EquipmentPosition); om.Write(this.InventoryPosition); }
/// <summary> /// write to the message /// </summary> /// <param name="message">message to write to</param> public void OnSerialize(NetOutgoingMessage message) { message.Write(X); message.Write(Y); message.Write(Z); message.Write(W); }
public void Encode(NetOutgoingMessage om) { om.Write(this.BlockID); om.Write(this.X); om.Write(this.Y); om.Write(this.Z); }
public void Encode(NetOutgoingMessage om) { om.Write((int) Value); om.Write(Text); om.Write(Row); om.Write(Col); }
public override void Write(NetOutgoingMessage msg) { msg.Write(Id); msg.Write(Cards.Count); foreach(string value in Cards) msg.Write(value); }
public static void Write(NetOutgoingMessage msg, Quaternion data) { msg.Write(data.x); msg.Write(data.y); msg.Write(data.z); msg.Write(data.w); }
public void WriteType(NetOutgoingMessage Message, AttributeTypeID Type, object Data) { switch (Type) { case AttributeTypeID.Float: Message.Write((float)Data); break; case AttributeTypeID.Int: Message.Write((int)Data); break; case AttributeTypeID.List: Console.WriteLine("Engine unable to serialize list objects"); break; case AttributeTypeID.Long: Message.Write((long)Data); break; case AttributeTypeID.Rectangle: Message.WriteRectangle((Rectangle)Data); break; case AttributeTypeID.String: Message.Write((string)Data); break; case AttributeTypeID.Vector2: Message.WriteVector2((Vector2)Data); break; case AttributeTypeID.Bool: Message.Write((bool)Data); break; default: Console.WriteLine("AttributeSystem Unrecognised Type In AttributeSystem Type: {0}", Type.ToString()); break; } }
public NetOutgoingMessage Pack(NetOutgoingMessage msg) { msg.Write((byte)packetType); msg.Write(username); msg.Write(message); return msg; }
public void Encode(NetOutgoingMessage om) { om.Write(Shots); om.Write(Hits); om.Write(Misses); om.Write(ShipsKilled); }
public void SendCurrentWorld(ServerPlayer player) { _outmsg = _netserver.CreateMessage(); _outmsg.Write((byte)PacketType.WorldMapSize); _outmsg.Write(_mineserver.MapManager.Mapsize); _netserver.SendMessage(_outmsg, player.NetConn, NetDeliveryMethod.ReliableOrdered); }
public void Encode(NetOutgoingMessage om) { om.Write(this.MessageTime); om.Write(this.Id); om.Write(this.OldPosition); om.Write(this.NewPosition); }
public void SendBlockSet(BlockTypes type,Vector3 pos) { _outmsg = _client.CreateMessage(); _outmsg.Write((byte)PacketType.PlayerBlockSet); _outmsg.Write(pos); _outmsg.Write((byte)type); }
public void Encode(NetOutgoingMessage om) { om.Write(this.Id); om.Write(this.MessageTime); om.Write(this.Health); om.Write(this.MaxHealth); }
protected override void WriteData(NetOutgoingMessage Message) { texture.Write(Message); byte[] data = GetBytes(texture.Texture); Message.Write((Int32)data.Length); Message.Write(data); }
public void WriteToMessage(NetOutgoingMessage message) { message.Write(SessionID); message.Write(ID); message.Write(IsValid); message.Write(Position); message.Write(Angle); }
public void WriteDelta(NetOutgoingMessage message) { message.Write(Sequence); message.Write(FromSequence); byte[] bytes = deltaBytes.ToArray(); message.Write(bytes.Length); message.Write(bytes); }
protected override void Write(NetOutgoingMessage message) { message.Write(ship.Name); message.Write(ship.Body.Position.X * Constants.PixelsPerMeter); message.Write(ship.Body.Position.Y * Constants.PixelsPerMeter); message.Write(ship.Body.Rotation.ToNetworkRotation()); message.Write((byte)(ship.Health * byte.MaxValue)); }
/// <summary> /// Writes the contents of this type to the transport. /// </summary> public void WritePayload(NetOutgoingMessage message) { message.Write(Identity); message.Write(NovaId); message.Write(PasswordHash); message.Write(PublicEndPoint); message.Write(PrivateEndPoint); }
public override void WritePayload(NetOutgoingMessage message) { base.WritePayload(message); message.Write(Image.Length); message.Write(Image); message.Write(Number); message.Write(SendIndex); }
/// <summary> /// serialize to the message /// </summary> /// <param name="message"></param> public void OnSerialize(Lidgren.Network.NetOutgoingMessage message) { message.Write(dictionary.Count); foreach (var kvp in dictionary) { message.Write(kvp.Key); message.Write(kvp.Value); } }
public override void WriteOutUpdateData(Lidgren.Network.NetOutgoingMessage om) { base.WriteOutUpdateData(om); om.Write(this.elapsedTime); }
/// <summary> /// Serialize the array to the message /// </summary> /// <param name="message"></param> public void OnSerialize(Lidgren.Network.NetOutgoingMessage message) { if (items == null || items.Length == 0) { return; } message.Write(items.Length); foreach (var item in items) { item.OnSerialize(message); } }
static void Main(string[] args) { var config = new NetPeerConfiguration("ConquerLeague") { Port = 47410 }; config.EnableMessageType(NetIncomingMessageType.DiscoveryRequest); server = new NetServer(config); server.Start(); SessionManager sessionManager = new SessionManager(); while (true) { NetIncomingMessage message; while ((message = server.ReadMessage()) != null) { switch (message.MessageType) { case NetIncomingMessageType.DiscoveryRequest: NetOutgoingMessage response = server.CreateMessage(); // Create a response and write some example data to it response.Write("ConquerLeagueServer"); server.SendDiscoveryResponse(response, message.SenderEndPoint); // Send the response to the sender of the request break; case NetIncomingMessageType.Data: var dataLength = message.ReadInt32(); var data = message.ReadBytes(dataLength); sessionManager.ForwardMessageToSession(message.SenderConnection, dataLength, data); break; case NetIncomingMessageType.StatusChanged: Console.WriteLine(message.SenderConnection.Status); switch (message.SenderConnection.Status) { case NetConnectionStatus.Connected: Console.WriteLine("Client " + message.SenderConnection.RemoteEndPoint.ToString() + " connected!"); sessionManager.AddPlayerToMatchmaking(message.SenderConnection); break; case NetConnectionStatus.RespondedConnect: Console.WriteLine(message.SenderConnection.Status.ToString()); break; default: Console.WriteLine("Unhandled status change with type: " + message.SenderConnection.Status.ToString()); break; } break; case NetIncomingMessageType.ConnectionApproval: message.SenderConnection.Approve(); break; case NetIncomingMessageType.DebugMessage: Console.WriteLine(message.ReadString()); break; case NetIncomingMessageType.WarningMessage: Console.WriteLine("Warning: " + message.ReadString()); break; default: Console.WriteLine("unhandled message with type: " + message.MessageType); break; } server.Recycle(message); } } }