Ejemplo n.º 1
0
        public async void OnBar(Session session, BarPacket packet)
        {
            //Console.WriteLine(SynchronizationContext.Current == null);
            //Thread.CurrentPrincipal.Identity.

            Console.WriteLine(SynchronizationContext.Current);

            Console.WriteLine("OnBar " + packet.resp);

            /*
            Console.WriteLine(Server.isSafeThread);

            await Scheduler.current.Yield(2000);
            Console.WriteLine("NExt");
            //Console.WriteLine(packet.data);

            Console.WriteLine(Server.isSafeThread);
            */
            var p = new FooPacket();
            p.bind = "ASDdsddsFddd";
            session.Send(p);
        }
Ejemplo n.º 2
0
        public async void OnFoo(Session session, FooPacket packet)
        {
            FooPacket f = new FooPacket();
            f.Serialize();

            Console.WriteLine("OnPacket " + Thread.CurrentThread.ManagedThreadId.ToString());
            packet.Dump();


            var a = Scheduler.current.Schedule(() =>
            {
                Console.WriteLine("hello world");
            }, 100, 0, 2);
            a.Cancel();
            //

            Model.FindOneAsync<Player>(packet);
        }
Ejemplo n.º 3
0
 public async void OnChat(Session session, FooPacket packet)
 {
     Console.WriteLine("onChat");
 }