R2G_GetLoginKeyHandler.cs 589 字节
Newer Older
1
using System;
2
using System.Threading.Tasks;
3 4 5 6 7 8
using Base;
using Model;

namespace Controller
{
	[MessageHandler(AppType.Gate)]
T
tanghai 已提交
9
	public class R2G_GetLoginKeyHandler : AMRpcHandler<R2G_GetLoginKey, G2R_GetLoginKey>
10
	{
11
		protected override void Run(Session session, R2G_GetLoginKey message, Action<G2R_GetLoginKey> reply)
12
		{
13 14 15 16 17 18 19 20 21 22 23
			G2R_GetLoginKey response = new G2R_GetLoginKey();
			try
			{
				long key = Game.Scene.GetComponent<GateSessionKeyComponent>().Get();
				response.Key = key;
				reply(response);
			}
			catch (Exception e)
			{
				ReplyError(response, e, reply);
			}
24 25 26
		}
	}
}