From 59c0550cfcc9283ae6a8b353ca545f4348e23334 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 16 Apr 2019 14:51:37 +0100 Subject: [PATCH] ServerList namespace --- Facepunch.Steamworks.Test/ServerlistTest.cs | 14 +++++++------- .../ServerList/{BaseServerList.cs => Base.cs} | 9 +++------ ...{ServerListFavourites.cs => Favourites.cs} | 7 ++----- .../{ServerListFriends.cs => Friends.cs} | 7 ++----- .../{ServerListHistory.cs => History.cs} | 7 ++----- .../{ServerListInternet.cs => Internet.cs} | 7 ++----- .../{ServerListLan.cs => LocalNetwork.cs} | 7 ++----- .../ServerList/ServerListSpectator.cs | 19 ------------------- 8 files changed, 20 insertions(+), 57 deletions(-) rename Facepunch.Steamworks/ServerList/{BaseServerList.cs => Base.cs} (96%) rename Facepunch.Steamworks/ServerList/{ServerListFavourites.cs => Favourites.cs} (71%) rename Facepunch.Steamworks/ServerList/{ServerListFriends.cs => Friends.cs} (72%) rename Facepunch.Steamworks/ServerList/{ServerListHistory.cs => History.cs} (72%) rename Facepunch.Steamworks/ServerList/{ServerListInternet.cs => Internet.cs} (72%) rename Facepunch.Steamworks/ServerList/{ServerListLan.cs => LocalNetwork.cs} (68%) delete mode 100644 Facepunch.Steamworks/ServerList/ServerListSpectator.cs diff --git a/Facepunch.Steamworks.Test/ServerlistTest.cs b/Facepunch.Steamworks.Test/ServerlistTest.cs index a6a1f97..940c5ed 100644 --- a/Facepunch.Steamworks.Test/ServerlistTest.cs +++ b/Facepunch.Steamworks.Test/ServerlistTest.cs @@ -33,7 +33,7 @@ namespace Steamworks [TestMethod] public async Task ServerListInternetInterupted() { - using ( var list = new ServerListInternet() ) + using ( var list = new ServerList.Internet() ) { var task = list.RunQueryAsync(); @@ -58,7 +58,7 @@ namespace Steamworks [TestMethod] public async Task ServerListInternet() { - using ( var list = new ServerListInternet() ) + using ( var list = new ServerList.Internet() ) { var success = await list.RunQueryAsync(); @@ -71,7 +71,7 @@ namespace Steamworks [TestMethod] public async Task ServerListLan() { - using ( var list = new ServerListLan() ) + using ( var list = new ServerList.LocalNetwork() ) { var success = await list.RunQueryAsync(); @@ -84,7 +84,7 @@ namespace Steamworks [TestMethod] public async Task ServerListFavourites() { - using ( var list = new ServerListFavourites() ) + using ( var list = new ServerList.Favourites() ) { var success = await list.RunQueryAsync(); @@ -97,7 +97,7 @@ namespace Steamworks [TestMethod] public async Task ServerListFriends() { - using ( var list = new ServerListFriends() ) + using ( var list = new ServerList.Friends() ) { var success = await list.RunQueryAsync(); @@ -110,7 +110,7 @@ namespace Steamworks [TestMethod] public async Task ServerListHistory() { - using ( var list = new ServerListHistory() ) + using ( var list = new ServerList.History() ) { var success = await list.RunQueryAsync(); @@ -123,7 +123,7 @@ namespace Steamworks [TestMethod] public async Task FilterByMap() { - using ( var list = new ServerListInternet() ) + using ( var list = new ServerList.Internet() ) { list.AddFilter( "map", "de_dust" ); diff --git a/Facepunch.Steamworks/ServerList/BaseServerList.cs b/Facepunch.Steamworks/ServerList/Base.cs similarity index 96% rename from Facepunch.Steamworks/ServerList/BaseServerList.cs rename to Facepunch.Steamworks/ServerList/Base.cs index bb71241..153f3b2 100644 --- a/Facepunch.Steamworks/ServerList/BaseServerList.cs +++ b/Facepunch.Steamworks/ServerList/Base.cs @@ -5,12 +5,9 @@ using System.Text; using System.Threading.Tasks; using Steamworks.Data; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public abstract class BaseServerList : IDisposable + public abstract class Base : IDisposable { #region ISteamMatchmakingServers @@ -57,7 +54,7 @@ namespace Steamworks public List Unresponsive = new List(); - public BaseServerList() + public Base() { AppId = SteamUtils.AppId; // Default AppId is this } diff --git a/Facepunch.Steamworks/ServerList/ServerListFavourites.cs b/Facepunch.Steamworks/ServerList/Favourites.cs similarity index 71% rename from Facepunch.Steamworks/ServerList/ServerListFavourites.cs rename to Facepunch.Steamworks/ServerList/Favourites.cs index 8c7a0e9..6f1ffa3 100644 --- a/Facepunch.Steamworks/ServerList/ServerListFavourites.cs +++ b/Facepunch.Steamworks/ServerList/Favourites.cs @@ -4,12 +4,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public class ServerListFavourites : BaseServerList + public class Favourites : Base { internal override void LaunchQuery() { diff --git a/Facepunch.Steamworks/ServerList/ServerListFriends.cs b/Facepunch.Steamworks/ServerList/Friends.cs similarity index 72% rename from Facepunch.Steamworks/ServerList/ServerListFriends.cs rename to Facepunch.Steamworks/ServerList/Friends.cs index 588688b..eb66a69 100644 --- a/Facepunch.Steamworks/ServerList/ServerListFriends.cs +++ b/Facepunch.Steamworks/ServerList/Friends.cs @@ -4,12 +4,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public class ServerListFriends : BaseServerList + public class Friends : Base { internal override void LaunchQuery() { diff --git a/Facepunch.Steamworks/ServerList/ServerListHistory.cs b/Facepunch.Steamworks/ServerList/History.cs similarity index 72% rename from Facepunch.Steamworks/ServerList/ServerListHistory.cs rename to Facepunch.Steamworks/ServerList/History.cs index 61093a6..55ccc16 100644 --- a/Facepunch.Steamworks/ServerList/ServerListHistory.cs +++ b/Facepunch.Steamworks/ServerList/History.cs @@ -4,12 +4,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public class ServerListHistory : BaseServerList + public class History : Base { internal override void LaunchQuery() { diff --git a/Facepunch.Steamworks/ServerList/ServerListInternet.cs b/Facepunch.Steamworks/ServerList/Internet.cs similarity index 72% rename from Facepunch.Steamworks/ServerList/ServerListInternet.cs rename to Facepunch.Steamworks/ServerList/Internet.cs index 7849c61..abb2fd0 100644 --- a/Facepunch.Steamworks/ServerList/ServerListInternet.cs +++ b/Facepunch.Steamworks/ServerList/Internet.cs @@ -4,12 +4,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public class ServerListInternet : BaseServerList + public class Internet : Base { internal override void LaunchQuery() { diff --git a/Facepunch.Steamworks/ServerList/ServerListLan.cs b/Facepunch.Steamworks/ServerList/LocalNetwork.cs similarity index 68% rename from Facepunch.Steamworks/ServerList/ServerListLan.cs rename to Facepunch.Steamworks/ServerList/LocalNetwork.cs index 475eb29..7468873 100644 --- a/Facepunch.Steamworks/ServerList/ServerListLan.cs +++ b/Facepunch.Steamworks/ServerList/LocalNetwork.cs @@ -4,12 +4,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace Steamworks +namespace Steamworks.ServerList { - /// - /// Not for reuse by newbs - /// - public class ServerListLan : BaseServerList + public class LocalNetwork : Base { internal override void LaunchQuery() { diff --git a/Facepunch.Steamworks/ServerList/ServerListSpectator.cs b/Facepunch.Steamworks/ServerList/ServerListSpectator.cs deleted file mode 100644 index 1ed2852..0000000 --- a/Facepunch.Steamworks/ServerList/ServerListSpectator.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Steamworks -{ - /* - public class ServerListSpectator : BaseServerList - { - internal override void LaunchQuery() - { - var filters = GetFilters(); - request = Internal.RequestSpectatorServerList( AppId.Value, filters, (uint)filters.Length, IntPtr.Zero ); - } - } - */ -} \ No newline at end of file