Пример #1
0
        public void Test_HelloWorld(UnityServer.SimulationClient client)
        {
            client.session.RegisterHandler(MsgSvrCli_Greeting_Ans.MSG_ID, (MsgSvrCli_Greeting_Ans ans) =>
            {
                client.number = 2;
                client.session.UnregisterHandler(MsgSvrCli_Greeting_Ans.MSG_ID);

                MsgCliSvr_Greeting_Ntf ntf = new MsgCliSvr_Greeting_Ntf();
                ntf.text = "FIN_" + client.number.ToString();

                Gamnet.Packet ntfPacket = new Gamnet.Packet();
                ntfPacket.Id            = MsgCliSvr_Greeting_Ntf.MSG_ID;
                ntfPacket.Serialize(ntf);
                client.session.Send(ntfPacket);
                client.MoveNext();
            });

            client.number = 1;
            MsgCliSvr_Greeting_Req req = new MsgCliSvr_Greeting_Req();

            req.text = "SIN_" + client.number.ToString();

            Gamnet.Packet packet = new Gamnet.Packet();
            packet.Id = MsgCliSvr_Greeting_Req.MSG_ID;
            packet.Serialize(req);
            packet.IsReliable = true;
            Debug.Log($"HelloWorld.MsgCliSvr_Greeting_Req");
            client.session.Send(packet);
        }
Пример #2
0
 public void Test_PauseAndResume(UnityServer.SimulationClient client)
 {
     client.session.Pause();
     client.MoveNext();
 }