Exemplo n.º 1
0
 public static TcpSocketImpl getInstance()
 {
     if (instance == null)
     {
         instance = new TcpSocketImpl();
     }
     return(instance);
 }
Exemplo n.º 2
0
        public static void CreateTcpProxy(Type obj, string methodName, List <string> args, short gameId)
        {
            //var clazzType = (Proxy)Attribute.GetCustomAttribute(obj, typeof(Proxy));
            //if (clazzType == null)
            //{
            //    throw new NullReferenceException("");
            //}
            //   short gameId = clazzType.gameId;
            ClientTcpIoMessage client = new ClientTcpIoMessage();

            client.interfaceName = obj.FullName;
            client.methodName    = methodName;
            // client.args = JsonConvert.SerializeObject(callMessage.Args);
            if (args != null)
            {
                client.args = JsonMapper.ToJson(args);
            }
            else
            {
                client.args = null;
            }
            TcpSocketImpl.getInstance().async(client, gameId, -10);
        }