Skip to content

Commit

Permalink
删除过时代码
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoKyaku committed Oct 29, 2022
1 parent 92ce62d commit 0b22892
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 53 deletions.
5 changes: 2 additions & 3 deletions Megumin.Remote/SendOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public interface IForceUdpDataOnKcpRemote

public class SendOption : IRpcTimeoutOption, ICmdOption, IRpcThreadOption, IForceUdpDataOnKcpRemote
{
public static readonly SendOption Never = new SendOption() { MillisecondsDelay = -1, MillisecondsTimeout = -1 };
public static readonly SendOption Echo = new SendOption() { MillisecondsDelay = 30000, MillisecondsTimeout = 30000, Cmd = 1 };
public int MillisecondsDelay { get; set; } = 30000;
public static readonly SendOption Never = new SendOption() { MillisecondsTimeout = -1 };
public static readonly SendOption Echo = new SendOption() { MillisecondsTimeout = 30000, Cmd = 1 };
public int MillisecondsTimeout { get; set; } = 30000;
public short Cmd { get; set; } = 0;
public bool? RpcComplatePost2ThreadScheduler { get; set; } = null;
Expand Down
7 changes: 1 addition & 6 deletions Megumin.Remote/TimeStampSynchronization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,12 @@ public async ValueTask Sync(ISendAsyncable remote, int count = 20, int interval

protected static readonly SendOption sendOption = new SendOption()
{
MillisecondsDelay = 2000,
MillisecondsTimeout = 2000,
RpcComplatePost2ThreadScheduler = false,
};

public async Task<OffsetValue> GetOffset(ISendAsyncable remote, int index = 0)
{
SendOption sendOption = new SendOption()
{
MillisecondsDelay = 2000,
RpcComplatePost2ThreadScheduler = false,
};
var sendTime = DateTimeOffset.UtcNow;
var (remotetime, ex) = await remote.SendAsync<DateTimeOffset>(new GetTime(), options: sendOption).ConfigureAwait(false);

Expand Down
5 changes: 0 additions & 5 deletions MessageStandard/MSGIDAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ public MSGID(int id)
public const int UdpConnectMessageID = 101;
public const int Authentication = 150;
/// <summary>
/// 心跳包ID,255好识别,buffer[10-13]=[255,0,0,0]
/// </summary>
[Obsolete("Use Heartbeat")]
public const int Heartbeats = 255;
/// <summary>
/// 心跳包ID,256好识别,buffer[10-13]=[255,1,0,0]
/// </summary>
public const int Heartbeat = 256;
Expand Down
26 changes: 0 additions & 26 deletions MessageStandard/MessageLUT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,30 +560,4 @@ public override void Write(byte[] buffer, int offset, int count)
public override long Length { get; } = long.MaxValue;
public override long Position { get; set; }
}


[Obsolete("Use TraceListener instead.", true)]
public interface ILogger
{
void Log(object message, object state = null);
void LogError(object message, object state = null);
void LogWarning(object message, object state = null);
}

/// <summary>
///
/// </summary>
[Obsolete("Use TraceListener instead.", true)]
public static class DebugLogger
{
public static ILogger Logger { get; set; }
public static void Log(object message, object state = null)
=> Logger?.Log(message, state);

public static void LogError(object message, object state = null)
=> Logger?.LogError(message, state);

public static void LogWarning(object message, object state = null)
=> Logger?.LogWarning(message, state);
}
}
6 changes: 3 additions & 3 deletions MessageStandard/MessageStandard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Authors>云却</Authors>

<!--版本配置-->
<Version>1.1.0.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<Version>1.2.0.0</Version>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>

<!--包配置-->
<Product>MeguminNet</Product>
Expand Down
10 changes: 0 additions & 10 deletions NetRemoteStandard/IRemote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ public interface ISendAsyncable
/// <remarks>不要定义OnReceive函数,由于具体业务逻辑不同,这个函数的签名可能有很多中变化,不能标准化。</remarks>
public interface IReceiveMessage
{
///// <summary>
///// 最后一次收到消息的时间
///// </summary>
//[Obsolete("DateTime 开销太大,使用时间戳代替")]
//DateTime LastReceiveTime { get; }
/// <summary>
/// 最后一次收到消息的时间戳,因为Unity中时间戳是float
/// </summary>
Expand Down Expand Up @@ -266,11 +261,6 @@ public interface IMultiplexing
/// </summary>
public interface IRpcTimeoutOption
{
/// <summary>
/// 指定毫秒后超时,-1表示永不超时。
/// </summary>
[Obsolete("Use MillisecondsTimeout instead.", true)]
int MillisecondsDelay { get; }
/// <summary>
/// 指定毫秒后超时,-1表示永不超时。
/// </summary>
Expand Down

0 comments on commit 0b22892

Please sign in to comment.