mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Remove old dead code, minor cleanup.
This commit is contained in:
@@ -24,8 +24,6 @@ namespace SS14.Client.Player
|
||||
/// </summary>
|
||||
public class PlayerManager : IPlayerManager
|
||||
{
|
||||
//private readonly List<PostProcessingEffect> _effects = new List<PostProcessingEffect>();
|
||||
|
||||
[Dependency]
|
||||
private readonly IClientNetManager _network;
|
||||
|
||||
@@ -69,10 +67,7 @@ namespace SS14.Client.Player
|
||||
_config.RegisterCVar("player.name", "Joe Genero", CVar.ARCHIVE);
|
||||
|
||||
_network.RegisterNetMessage<MsgPlayerListReq>(MsgPlayerListReq.NAME);
|
||||
|
||||
_network.RegisterNetMessage<MsgPlayerList>(MsgPlayerList.NAME, HandlePlayerList);
|
||||
|
||||
_network.RegisterNetMessage<MsgSession>(MsgSession.NAME, HandleSessionMessage);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -88,10 +83,7 @@ namespace SS14.Client.Player
|
||||
/// <inheritdoc />
|
||||
public void Update(float frameTime)
|
||||
{
|
||||
//foreach (var e in _effects.ToArray())
|
||||
//{
|
||||
// e.Update(frameTime);
|
||||
//}
|
||||
// Uh, nothing anymore I guess.
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -101,17 +93,6 @@ namespace SS14.Client.Player
|
||||
_sessions.Clear();
|
||||
}
|
||||
|
||||
/*
|
||||
/// <inheritdoc />
|
||||
public void ApplyEffects(RenderImage image)
|
||||
{
|
||||
foreach (var e in _effects)
|
||||
{
|
||||
e.ProcessImage(image);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ApplyPlayerStates(IEnumerable<PlayerState> list)
|
||||
{
|
||||
@@ -135,23 +116,6 @@ namespace SS14.Client.Player
|
||||
UpdatePlayerList(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles an incoming session NetMsg from the server.
|
||||
/// </summary>
|
||||
private void HandleSessionMessage(MsgSession msg)
|
||||
{
|
||||
switch (msg.MsgType)
|
||||
{
|
||||
case PlayerSessionMessage.AttachToEntity:
|
||||
break;
|
||||
case PlayerSessionMessage.JoinLobby:
|
||||
break;
|
||||
case PlayerSessionMessage.AddPostProcessingEffect:
|
||||
//AddEffect(msg.PpType, msg.PpDuration);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares the server sessionStatus to the client one, and updates if needed.
|
||||
/// </summary>
|
||||
@@ -235,7 +199,7 @@ namespace SS14.Client.Player
|
||||
foreach (var existing in hitSet)
|
||||
{
|
||||
// clear slot, player left
|
||||
if (!_sessions.TryGetValue(existing, out var local))
|
||||
if (!_sessions.ContainsKey(existing))
|
||||
{
|
||||
DebugTools.Assert(LocalPlayer.SessionId != existing, "I'm still connected to the server, but i left?");
|
||||
_sessions.Remove(existing);
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace SS14.Server.Interfaces.Player
|
||||
/// <summary>
|
||||
/// Initializes the manager.
|
||||
/// </summary>
|
||||
/// <param name="baseServer">The server that instantiated this manager.</param>
|
||||
/// <param name="maxPlayers">Maximum number of players that can connect to this server at one time.</param>
|
||||
void Initialize(int maxPlayers);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using SS14.Server.Player;
|
||||
using SS14.Shared.Enums;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
@@ -35,10 +34,9 @@ namespace SS14.Server.Interfaces.Player
|
||||
void DetachFromEntity();
|
||||
void OnConnect();
|
||||
void OnDisconnect();
|
||||
void AddPostProcessingEffect(PostProcessingEffectType type, float duration);
|
||||
|
||||
/// <summary>
|
||||
/// Persistant data for this player.
|
||||
/// Persistent data for this player.
|
||||
/// </summary>
|
||||
IPlayerData Data { get; }
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ namespace SS14.Server.Player
|
||||
_sessions = new Dictionary<NetSessionId, PlayerSession>(maxPlayers);
|
||||
_playerData = new Dictionary<NetSessionId, PlayerData>(maxPlayers);
|
||||
|
||||
_network.RegisterNetMessage<MsgSession>(MsgSession.NAME);
|
||||
_network.RegisterNetMessage<MsgServerInfoReq>(MsgServerInfoReq.NAME, HandleWelcomeMessageReq);
|
||||
_network.RegisterNetMessage<MsgServerInfo>(MsgServerInfo.NAME);
|
||||
_network.RegisterNetMessage<MsgPlayerListReq>(MsgPlayerListReq.NAME, HandlePlayerListReq);
|
||||
|
||||
@@ -9,7 +9,6 @@ using SS14.Server.Interfaces;
|
||||
using SS14.Shared.Enums;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
using SS14.Shared.Network.Messages;
|
||||
using SS14.Shared.Network;
|
||||
using SS14.Shared.ViewVariables;
|
||||
|
||||
@@ -107,7 +106,6 @@ namespace SS14.Server.Player
|
||||
|
||||
AttachedEntity = a;
|
||||
a.SendMessage(actorComponent, new PlayerAttachedMsg(this));
|
||||
SendAttachMessage();
|
||||
SetAttachedEntityName();
|
||||
UpdatePlayerState();
|
||||
}
|
||||
@@ -144,33 +142,6 @@ namespace SS14.Server.Player
|
||||
UpdatePlayerState();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddPostProcessingEffect(PostProcessingEffectType type, float duration)
|
||||
{
|
||||
var net = IoCManager.Resolve<IServerNetManager>();
|
||||
var message = net.CreateNetMessage<MsgSession>();
|
||||
|
||||
message.MsgType = PlayerSessionMessage.AddPostProcessingEffect;
|
||||
message.PpType = type;
|
||||
message.PpDuration = duration;
|
||||
|
||||
net.ServerSendMessage(message, ConnectedClient);
|
||||
}
|
||||
|
||||
private void SendAttachMessage()
|
||||
{
|
||||
if (AttachedEntity == null)
|
||||
throw new Exception("Cannot attach player session to entity: No entity attached.");
|
||||
|
||||
var net = IoCManager.Resolve<IServerNetManager>();
|
||||
var message = net.CreateNetMessage<MsgSession>();
|
||||
|
||||
message.MsgType = PlayerSessionMessage.AttachToEntity;
|
||||
message.Uid = AttachedEntity.Uid;
|
||||
|
||||
net.ServerSendMessage(message, ConnectedClient);
|
||||
}
|
||||
|
||||
private void SetAttachedEntityName()
|
||||
{
|
||||
if (Name != null && AttachedEntity != null)
|
||||
|
||||
@@ -20,13 +20,6 @@
|
||||
DeleteMap
|
||||
}
|
||||
|
||||
public enum PlayerSessionMessage
|
||||
{
|
||||
AttachToEntity,
|
||||
JoinLobby,
|
||||
AddPostProcessingEffect
|
||||
}
|
||||
|
||||
public enum SessionStatus : byte
|
||||
{
|
||||
Zombie = 0,
|
||||
@@ -53,12 +46,4 @@
|
||||
d_string,
|
||||
d_byteArray
|
||||
}
|
||||
|
||||
public enum PostProcessingEffectType
|
||||
{
|
||||
Blur,
|
||||
Death,
|
||||
Perlin,
|
||||
Acid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
namespace SS14.Shared.GameObjects
|
||||
{
|
||||
public enum ComponentMessageType
|
||||
{
|
||||
Null,
|
||||
Empty,
|
||||
BoundKeyChange, // U
|
||||
BoundKeyRepeat, // U
|
||||
SpriteChanged, // U
|
||||
Bumped, // U
|
||||
EntitySaidSomething, // U
|
||||
}
|
||||
|
||||
public enum DrawDepth
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace SS14.Shared.GameObjects
|
||||
{
|
||||
public struct ComponentReplyMessage
|
||||
{
|
||||
private static ComponentReplyMessage empty = new ComponentReplyMessage(ComponentMessageType.Empty);
|
||||
|
||||
public ComponentReplyMessage(ComponentMessageType messageType, params object[] paramsList) : this()
|
||||
{
|
||||
ParamsList = paramsList != null ? paramsList.ToList() : new List<object>();
|
||||
MessageType = messageType;
|
||||
}
|
||||
|
||||
public static ComponentReplyMessage Empty { get; set; }
|
||||
public ComponentMessageType MessageType { get; set; }
|
||||
public List<object> ParamsList { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using Lidgren.Network;
|
||||
using SS14.Shared.Enums;
|
||||
using SS14.Shared.GameObjects;
|
||||
using SS14.Shared.Interfaces.Network;
|
||||
|
||||
namespace SS14.Shared.Network.Messages
|
||||
{
|
||||
public class MsgSession : NetMessage
|
||||
{
|
||||
#region REQUIRED
|
||||
public static readonly MsgGroups GROUP = MsgGroups.Core;
|
||||
public static readonly string NAME = nameof(MsgSession);
|
||||
public MsgSession(INetChannel channel) : base(NAME, GROUP) { }
|
||||
#endregion
|
||||
|
||||
public PlayerSessionMessage MsgType { get; set; }
|
||||
public EntityUid Uid { get; set; }
|
||||
public PostProcessingEffectType PpType { get; set; }
|
||||
public float PpDuration { get; set; }
|
||||
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
||||
{
|
||||
MsgType = (PlayerSessionMessage) buffer.ReadByte();
|
||||
|
||||
switch (MsgType)
|
||||
{
|
||||
case PlayerSessionMessage.AttachToEntity:
|
||||
Uid = new EntityUid(buffer.ReadInt32());
|
||||
break;
|
||||
case PlayerSessionMessage.AddPostProcessingEffect:
|
||||
PpType = (PostProcessingEffectType) buffer.ReadInt32();
|
||||
PpDuration = buffer.ReadFloat();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
||||
{
|
||||
buffer.Write((byte)MsgType);
|
||||
switch (MsgType)
|
||||
{
|
||||
case PlayerSessionMessage.AttachToEntity:
|
||||
buffer.Write((int)Uid);
|
||||
break;
|
||||
case PlayerSessionMessage.AddPostProcessingEffect:
|
||||
buffer.Write((int)PpType);
|
||||
buffer.Write(PpDuration);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,6 @@
|
||||
<Compile Include="Network\Messages\MsgPlayerListReq.cs" />
|
||||
<Compile Include="Network\Messages\MsgServerInfo.cs" />
|
||||
<Compile Include="Network\Messages\MsgServerInfoReq.cs" />
|
||||
<Compile Include="Network\Messages\MsgSession.cs" />
|
||||
<Compile Include="Network\Messages\MsgStateAck.cs" />
|
||||
<Compile Include="Network\NetChannel.cs" />
|
||||
<Compile Include="Network\NetMessage.cs" />
|
||||
@@ -253,7 +252,6 @@
|
||||
<Compile Include="Utility\CommandParsing.cs" />
|
||||
<Compile Include="Utility\NetParamsPacker.cs" />
|
||||
<Compile Include="Utility\PlatformDetector.cs" />
|
||||
<Compile Include="Utility\PlatformTools.cs" />
|
||||
<Compile Include="Utility\RandomString.cs" />
|
||||
<Compile Include="Utility\Range.cs" />
|
||||
<Compile Include="Utility\TypeHelpers.cs" />
|
||||
@@ -284,7 +282,6 @@
|
||||
<Compile Include="GameObjects\Components\Physics\PhysicsComponentState.cs" />
|
||||
<Compile Include="GameObjects\EntitySystemMessages\EntitySystemMessage.cs" />
|
||||
<Compile Include="GameObjects\ComponentEnums.cs" />
|
||||
<Compile Include="GameObjects\ComponentReplyMessage.cs" />
|
||||
<Compile Include="GameObjects\ComponentState.cs" />
|
||||
<Compile Include="GameObjects\EntityState.cs" />
|
||||
<Compile Include="Prototypes\IPrototype.cs" />
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace SS14.Shared.Utility
|
||||
{
|
||||
public class PlatformTools
|
||||
{
|
||||
public static string SanePath(String pathname)
|
||||
{
|
||||
// sanitize the pathname in config.xml for the current OS
|
||||
// N.B.: You cannot use Path.DirectorySeparatorChar and
|
||||
// Path.AltDirectorySeparatorChar here, because on some platforms
|
||||
// they are the same. Mono/linux has both as '/', for example.
|
||||
// Hardcode the only platforms we care about.
|
||||
|
||||
var separators = new char[] { '/', '\\' };
|
||||
string newpath = "";
|
||||
foreach (string tmp in pathname.Split(separators))
|
||||
newpath = Path.Combine(newpath, tmp);
|
||||
return newpath;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user