-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve patch and allow metabolism disable
- Host can now disable metabolism if they wish
- Loading branch information
Showing
8 changed files
with
118 additions
and
18 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
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
28 changes: 28 additions & 0 deletions
28
Fika.Core/Networking/Packets/Backend/SessionSettingsPacket.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,28 @@ | ||
using LiteNetLib.Utils; | ||
|
||
namespace Fika.Core.Networking | ||
{ | ||
public struct SessionSettingsPacket(bool isRequest) : INetSerializable | ||
{ | ||
public bool IsRequest = isRequest; | ||
public bool MetabolismDisabled; | ||
|
||
public void Deserialize(NetDataReader reader) | ||
{ | ||
IsRequest = reader.GetBool(); | ||
if (!IsRequest) | ||
{ | ||
MetabolismDisabled = reader.GetBool(); | ||
} | ||
} | ||
|
||
public void Serialize(NetDataWriter writer) | ||
{ | ||
writer.Put(IsRequest); | ||
if (!IsRequest) | ||
{ | ||
writer.Put(MetabolismDisabled); | ||
} | ||
} | ||
} | ||
} |