private void OnMessagePortRequest() { using (OutPacket outPacket = new OutPacket(InteroperabilityMessage.MessagePortResponse)) { if (this.World.MessageServer != null) { InteroperabilityClient message = this.World.MessageServer; outPacket.WriteUShort((ushort)message.RemoteEndPoint.Port); } else { outPacket.WriteUShort(); } this.Send(outPacket); } }
private void OnShopPortRequest() { using (OutPacket outPacket = new OutPacket(InteroperabilityMessage.ShopPortResposne)) { if (this.World.ShopServer != null) { InteroperabilityClient shop = this.World.ShopServer; outPacket.WriteUShort((ushort)shop.RemoteEndPoint.Port); } else { outPacket.WriteUShort(); } this.Send(outPacket); } }
private void OnGamePortRequest(InPacket inPacket) { byte id = inPacket.ReadByte(); using (OutPacket outPacket = new OutPacket(InteroperabilityMessage.GamePortResponse)) { outPacket.WriteByte(id); if (this.World.Contains(id)) { InteroperabilityClient game = this.World[id]; outPacket.WriteUShort((ushort)game.RemoteEndPoint.Port); } else { outPacket.WriteUShort(); } this.Send(outPacket); } }