Beispiel #1
0
        private void StopMatch()
        {
            if (_matchId == null)
            {
                return;
            }
            var req = new StopMatchRequest {
                MatchId = _matchId
            }.ToByteString().ToStringUtf8();

            // Just skip assertion, it takes time to do the k8s delete, timeout, should work :p
            try
            {
                _socket.RpcAsync("stop_match", req);
            }
            catch (Exception)
            {
                // ignored
            }

            Console.WriteLine("Match stopped");

            // Assert.NotNull(res.Payload);
            // var parsedRes = CreateMatchResponse.Parser.ParseFrom(Encoding.UTF8.GetBytes(res.Payload));
            // Assert.NotNull(parsedRes);
            // Assert.AreEqual(StopMatchCompletionResult.StopServerCompletionResultSucceeded, parsedRes.Result);
            // res = await _socket.RpcAsync("delete_all_accounts");
            // Assert.NotNull(res.Payload);
        }
Beispiel #2
0
        public async void StopMatch()
        {
            var p = new StopMatchRequest
            {
                MatchId = m_MatchId
            }.ToByteString().ToStringUtf8();
            var protoResponse = await Sm.instance.Socket.RpcAsync("stop_match", p);

            var response = StopMatchResponse.Parser.ParseFrom(Encoding.UTF8.GetBytes(protoResponse.Payload));

            Debug.Log($"StopServer response: {response}");
        }
Beispiel #3
0
        private async void StopMatch(string m)
        {
            var p = new StopMatchRequest()
            {
                MatchId = m
            }.ToByteString().ToStringUtf8();
            var protoResponse = await SessionManager.instance.socket.RpcAsync("stop_match", p);

            var response = StopMatchResponse.Parser.ParseFrom(Encoding.UTF8.GetBytes(protoResponse.Payload));

            Debug.Log($"StopServer response: {response}");
        }
Beispiel #4
0
        public async Task TearDown()
        {
            if (_matchId == null)
            {
                return;
            }
            var req = new StopMatchRequest {
                MatchId = _matchId
            }.ToByteString().ToStringUtf8();
            var res = await _socket.RpcAsync("stop_match", req);

            Assert.NotNull(res.Payload);
            var parsedRes = CreateMatchResponse.Parser.ParseFrom(Encoding.UTF8.GetBytes(res.Payload));

            Assert.NotNull(parsedRes);
            Assert.AreEqual(StopMatchCompletionResult.StopServerCompletionResultSucceeded, parsedRes.Result);
        }
Beispiel #5
0
 void Start()
 {
     m_StopMatchRequest = GetComponent <StopMatchRequest>();
 }