Cleaned up code after my massive bug fix

This commit is contained in:
Bob Da Ross
2021-05-10 16:12:30 -05:00
parent b0d7c033b6
commit f3d37ae0d2
10 changed files with 825 additions and 1002 deletions

View File

@@ -1,6 +1,7 @@
using ProtoBuf;
using Sandbox.Game.World;
using Sandbox.ModAPI;
using SeamlessClientPlugin.SeamlessTransfer;
using SeamlessClientPlugin.Utilities;
using System;
using System.Collections.Generic;
@@ -31,15 +32,13 @@ namespace SeamlessClientPlugin.ClientMessages
[ProtoMember(5)]
public string PluginVersion = "0";
public ClientMessage(ClientMessageType Type)
{
MessageType = Type;
if (MyAPIGateway.Multiplayer != null && !MyAPIGateway.Multiplayer.IsServer)
{
if(MyAPIGateway.Session.LocalHumanPlayer == null)
if (MyAPIGateway.Session.LocalHumanPlayer == null)
{
return;
}
@@ -57,12 +56,15 @@ namespace SeamlessClientPlugin.ClientMessages
MessageData = Utility.Serialize(Data);
}
public T DeserializeData<T>()
public Transfer GetTransferData()
{
if (MessageData == null)
return default(T);
return default(Transfer);
return Utility.Deserialize<Transfer>(MessageData);
return Utility.Deserialize<T>(MessageData);
}
}
}