コード例 #1
0
 public async Task SetSessionDataTest(PitayaSession pitayaSession, RPCMsg msg)
 {
     pitayaSession.Set("msg", "testingMsg");
     pitayaSession.Set("int", 3);
     pitayaSession.Set("double", 3.33);
     await pitayaSession.PushToFrontend();
 }
コード例 #2
0
        public async Task <RPCRes> Entry(PitayaSession pitayaSession, RPCMsg msg)
        {
            var response = new NPitaya.Protos.RPCRes
            {
                Msg  = $"hello from csharp handler!!! :) {Guid.NewGuid().ToString()}",
                Code = 200
            };

            return(response);
        }
コード例 #3
0
        public async Task NotifyBind(PitayaSession pitayaSession, RPCMsg msg)
        {
            var response = new MyResponse
            {
                Msg  = $"hello from csharp handler!!! :) {Guid.NewGuid().ToString()}",
                Code = 200
            };

            await pitayaSession.Bind("uidbla");

            Console.WriteLine("handler executed with arg {0}", msg);
            Console.WriteLine("handler executed with session ipversion {0}", pitayaSession.GetString("ipversion"));
        }
コード例 #4
0
        public async Task <MyResponse> Entry(PitayaSession session, RPCMsg msg)
        {
            try
            {
                await session.Bind("CSHARP_UID");
            }
            catch (Exception e)
            {
                Console.WriteLine($"session bind error: {e.Message}");
            }

            var response = new MyResponse
            {
                Msg  = $"WUJOQWIEJOIQWJEOIQWJEOIQJWEOIJQWIOJE",
                Code = 200
            };

            return(response);
        }