Updated for F3 Meun
This commit is contained in:
@@ -3,13 +3,15 @@ using Sandbox.Game.World;
|
||||
using Sandbox.ModAPI;
|
||||
using SeamlessClientPlugin.SeamlessTransfer;
|
||||
using SeamlessClientPlugin.Utilities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SeamlessClientPlugin.ClientMessages
|
||||
namespace SeamlessClientPlugin.Messages
|
||||
{
|
||||
public enum ClientMessageType
|
||||
{
|
||||
FirstJoin,
|
||||
TransferServer
|
||||
TransferServer,
|
||||
OnlinePlayers,
|
||||
}
|
||||
|
||||
|
||||
@@ -61,5 +63,15 @@ namespace SeamlessClientPlugin.ClientMessages
|
||||
|
||||
}
|
||||
|
||||
public OnlinePlayersMessage GetOnlinePlayers()
|
||||
{
|
||||
if (MessageData == null)
|
||||
return default(OnlinePlayersMessage);
|
||||
|
||||
|
||||
OnlinePlayersMessage msg = Utility.Deserialize<OnlinePlayersMessage>(MessageData);
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
73
Messages/OnlinePlayersMessage.cs
Normal file
73
Messages/OnlinePlayersMessage.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using ProtoBuf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SeamlessClientPlugin.Messages
|
||||
{
|
||||
|
||||
[ProtoContract]
|
||||
public class OnlinePlayersMessage
|
||||
{
|
||||
[ProtoMember(10)]
|
||||
public List<OnlineServer> OnlineServers = new List<OnlineServer>();
|
||||
|
||||
[ProtoMember(12)]
|
||||
public int currentServerID;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class OnlineServer
|
||||
{
|
||||
|
||||
[ProtoMember(2)]
|
||||
public List<OnlinePlayer> Players = new List<OnlinePlayer>();
|
||||
|
||||
[ProtoMember(3)]
|
||||
public bool ServerRunning = false;
|
||||
|
||||
[ProtoMember(10)]
|
||||
public int ServerID;
|
||||
|
||||
[ProtoMember(11)]
|
||||
public string ServerName;
|
||||
|
||||
public OnlineServer() { }
|
||||
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class OnlinePlayer
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public string PlayerName;
|
||||
|
||||
[ProtoMember(2)]
|
||||
public ulong SteamID;
|
||||
|
||||
[ProtoMember(3)]
|
||||
public long IdentityID;
|
||||
|
||||
[ProtoMember(4)]
|
||||
public int OnServer;
|
||||
|
||||
public OnlinePlayer(string PlayerName, ulong SteamID, long IdentityID, int OnServer)
|
||||
{
|
||||
this.PlayerName = PlayerName;
|
||||
this.SteamID = SteamID;
|
||||
this.IdentityID = IdentityID;
|
||||
this.OnServer = OnServer;
|
||||
}
|
||||
|
||||
|
||||
public OnlinePlayer() { }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -8,7 +8,6 @@ using Sandbox.Game.Multiplayer;
|
||||
using Sandbox.Game.World;
|
||||
using Sandbox.Graphics.GUI;
|
||||
using Sandbox.ModAPI;
|
||||
using SeamlessClientPlugin.ClientMessages;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -25,7 +24,7 @@ using VRage.Steam;
|
||||
using VRage.Utils;
|
||||
using VRageMath;
|
||||
|
||||
namespace SeamlessClientPlugin.SeamlessTransfer
|
||||
namespace SeamlessClientPlugin.Messages
|
||||
{
|
||||
|
||||
[ProtoContract]
|
||||
|
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||
using VRage.Game;
|
||||
using VRage.ObjectBuilders;
|
||||
|
||||
namespace SeamlessClientPlugin.ClientMessages
|
||||
namespace SeamlessClientPlugin.Messages
|
||||
{
|
||||
[ProtoContract]
|
||||
public class WorldRequest
|
||||
|
Reference in New Issue
Block a user