-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
browse_rsc()
respect cache (#1814)
Co-authored-by: amylizzle <[email protected]>
- Loading branch information
Showing
8 changed files
with
145 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
using System; | ||
using Lidgren.Network; | ||
using Lidgren.Network; | ||
using Robust.Shared.Network; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace OpenDreamShared.Network.Messages { | ||
public sealed class MsgBrowseResource : NetMessage { | ||
// TODO: Browse should be on its own channel or something. | ||
public override MsgGroups MsgGroup => MsgGroups.EntityEvent; | ||
namespace OpenDreamShared.Network.Messages; | ||
public sealed class MsgBrowseResource : NetMessage { | ||
// TODO: Browse should be on its own channel or something. | ||
public override MsgGroups MsgGroup => MsgGroups.EntityEvent; | ||
|
||
public string Filename = String.Empty; | ||
public byte[] Data = Array.Empty<byte>(); | ||
public string Filename = string.Empty; | ||
public int DataHash; | ||
|
||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { | ||
Filename = buffer.ReadString(); | ||
var bytes = buffer.ReadVariableInt32(); | ||
Data = buffer.ReadBytes(bytes); | ||
} | ||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { | ||
Filename = buffer.ReadString(); | ||
DataHash = buffer.ReadVariableInt32(); | ||
} | ||
|
||
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { | ||
buffer.Write(Filename); | ||
buffer.WriteVariableInt32(Data.Length); | ||
buffer.Write(Data); | ||
} | ||
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { | ||
buffer.Write(Filename); | ||
buffer.WriteVariableInt32(DataHash); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
OpenDreamShared/Network/Messages/MsgBrowseResourceRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Lidgren.Network; | ||
using Robust.Shared.Network; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace OpenDreamShared.Network.Messages; | ||
public sealed class MsgBrowseResourceRequest : NetMessage { | ||
// TODO: Browse should be on its own channel or something. | ||
public override MsgGroups MsgGroup => MsgGroups.EntityEvent; | ||
|
||
public string Filename = string.Empty; | ||
|
||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { | ||
Filename = buffer.ReadString(); | ||
} | ||
|
||
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { | ||
buffer.Write(Filename); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
OpenDreamShared/Network/Messages/MsgBrowseResourceResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Lidgren.Network; | ||
using Robust.Shared.Network; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace OpenDreamShared.Network.Messages; | ||
public sealed class MsgBrowseResourceResponse : NetMessage { | ||
// TODO: Browse should be on its own channel or something. | ||
public override MsgGroups MsgGroup => MsgGroups.EntityEvent; | ||
|
||
public string Filename = string.Empty; | ||
public byte[] Data = []; | ||
|
||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { | ||
Filename = buffer.ReadString(); | ||
var bytes = buffer.ReadVariableInt32(); | ||
Data = buffer.ReadBytes(bytes); | ||
} | ||
|
||
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { | ||
buffer.Write(Filename); | ||
buffer.WriteVariableInt32(Data.Length); | ||
buffer.Write(Data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters