Example #1
0
        //void OnReturnToDivergencePointAnswer(NetworkMessage netMsg)
        //{
        //    ReturnToDivergencePointAnswerMessage msg = netMsg.ReadMessage<ReturnToDivergencePointAnswerMessage>();
        //    algorithmRespect.ReturnToDivergencePointAnswer.Value = msg.answer;
        //}

        void SendDirective(Directive directive)
        {
            DirectiveMessage msg = new DirectiveMessage();

            msg.directive = directive;
            client.Send(msg.GetMsgType(), msg);
        }
Example #2
0
        void StartServer()
        {
            if (server == null)
            {
                server = new NetworkServerSimple();
                server.RegisterHandler(MsgType.Connect, OnConnect);
                server.RegisterHandler(MsgType.Disconnect, OnDisconnect);
                server.RegisterHandler(DirectiveMessage.GetCustomMsgType(), OnDirective);
                server.RegisterHandler(RequestForGameInformationMessage.GetCustomMsgType(), OnRequestForGameInformation);
                server.RegisterHandler(ReturnToDivergencePointRequestMessage.GetCustomMsgType(), OnReturnToDivergencePointRequest);

                server.Listen(serverPort);
            }
        }
Example #3
0
        void OnDirective(NetworkMessage netMsg)
        {
            DirectiveMessage msg = netMsg.ReadMessage <DirectiveMessage>();

            directive.CurrentDirective.Set(msg.directive, notify: true);
        }