forked from Impostor/Impostor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Impostor#372 from miniduikboot/2021.3.31
- Loading branch information
Showing
15 changed files
with
153 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ public enum MapTypes : byte | |
Skeld = 0, | ||
MiraHQ = 1, | ||
Polus = 2, | ||
Airship = 4, | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Impostor.Api.Net.Messages.Rpcs | ||
{ | ||
public static class Rpc31ClimbLadder | ||
{ | ||
public static void Serialize(IMessageWriter writer, byte ladderId, byte lastClimbLadderSid) | ||
{ | ||
writer.Write(ladderId); | ||
writer.Write(lastClimbLadderSid); | ||
} | ||
|
||
public static void Deserialize(IMessageReader reader, out byte ladderId, out byte lastClimbLadderSid) | ||
{ | ||
ladderId = reader.ReadByte(); | ||
lastClimbLadderSid = reader.ReadByte(); | ||
} | ||
} | ||
} |
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,13 @@ | ||
namespace Impostor.Api.Net.Messages.Rpcs | ||
{ | ||
public static class Rpc32UsePlatform | ||
{ | ||
public static void Serialize(IMessageWriter writer) | ||
{ | ||
} | ||
|
||
public static void Deserialize(IMessageReader reader) | ||
{ | ||
} | ||
} | ||
} |
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
54 changes: 54 additions & 0 deletions
54
src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HeliSabotageSystemType.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,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Impostor.Api.Net.Messages; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Impostor.Server.Net.Inner.Objects.Systems.ShipStatus | ||
{ | ||
public class HeliSabotageSystemType : ISystemType, IActivatable | ||
{ | ||
public HeliSabotageSystemType() | ||
{ | ||
Countdown = 10000f; | ||
ActiveConsoles = new HashSet<Tuple<byte, byte>>(); | ||
CompletedConsoles = new HashSet<byte>(); | ||
} | ||
|
||
public float Countdown { get; private set; } | ||
|
||
public float Timer { get; private set; } | ||
|
||
public HashSet<Tuple<byte, byte>> ActiveConsoles { get; } | ||
|
||
public HashSet<byte> CompletedConsoles { get; } | ||
|
||
public bool IsActive => Countdown < 10000.0; | ||
|
||
public void Serialize(IMessageWriter writer, bool initialState) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Deserialize(IMessageReader reader, bool initialState) | ||
{ | ||
Countdown = reader.ReadSingle(); | ||
Timer = reader.ReadSingle(); | ||
ActiveConsoles.Clear(); // TODO: Thread safety | ||
CompletedConsoles.Clear(); // TODO: Thread safety | ||
|
||
var activeCount = reader.ReadPackedUInt32(); | ||
|
||
for (var i = 0; i < activeCount; i++) | ||
{ | ||
ActiveConsoles.Add(new Tuple<byte, byte>(reader.ReadByte(), reader.ReadByte())); | ||
} | ||
|
||
var completedCount = reader.ReadPackedUInt32(); | ||
|
||
for (var i = 0; i < completedCount; i++) | ||
{ | ||
CompletedConsoles.Add(reader.ReadByte()); | ||
} | ||
} | ||
} | ||
} |
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