예제 #1
0
 public static ProcessingResult Started(ServerMsgStart msgStart)
 {
     return(new ProcessingResult(ResultType.Started)
     {
         _msgStart = msgStart
     });
 }
예제 #2
0
        public void ShouldSerializeAndDeserializeStart(int seed, string[] players, byte yourIndex, byte tps)
        {
            var originalMsg = new ServerMsgStart(seed, players, yourIndex, tps);

            var buf     = CreateBuffer(originalMsg);
            var written = originalMsg.WriteTo(buf, 0);

            Assert.True(written == buf.Length);

            var restoredMsg = new ServerMsgStart(buf, 0);

            Assert.True(originalMsg.Seed == restoredMsg.Seed);
            Assert.True(originalMsg.YourIndex == restoredMsg.YourIndex);
            Assert.True(originalMsg.TicksPerSecond == restoredMsg.TicksPerSecond);

            Assert.True(originalMsg.Players.Length == restoredMsg.Players.Length);
            for (var i = 0; i < originalMsg.Players.Length; i++)
            {
                Assert.True(originalMsg.Players[i] == restoredMsg.Players[i]);
            }
        }
예제 #3
0
 public NetworkGameScreen(DPong game, ClientSession session, ServerMsgStart startMsg, in InputSourceDescriptor inputSrc)