-
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.
- Loading branch information
Showing
8 changed files
with
138 additions
and
23 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
20 changes: 20 additions & 0 deletions
20
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,20 @@ | ||
using System; | ||
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; | ||
Check notice Code scanning / InspectCode Replace built-in type reference with a CLR type name or a keyword in static member access expressions Note
Built-in type reference is inconsistent with code style settings
|
||
|
||
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer) { | ||
Filename = buffer.ReadString(); | ||
} | ||
|
||
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer) { | ||
buffer.Write(Filename); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
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,25 @@ | ||
using System; | ||
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; | ||
Check notice Code scanning / InspectCode Replace built-in type reference with a CLR type name or a keyword in static member access expressions Note
Built-in type reference is inconsistent with code style settings
|
||
public byte[] Data = Array.Empty<byte>(); | ||
Check notice Code scanning / InspectCode Use collection expression syntax Note
Use collection expression
|
||
|
||
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