Beispiel #1
0
        bool Query(ref object outArg, params object[] args)
        {
            if (args == null || args.Length != 2)
            {
                throw new ArgumentException();
            }

            string     dbName = args[0] as string;
            SqlCommand cmd    = args[1] as SqlCommand;

            uint id = 0;

            lock (_syncRoot)
            {
                id = _queryCount;
                _queryCount++;
            }

            e2g_exesql protocol = new e2g_exesql();

            protocol.nSessionID = id;
            protocol.szDatabase = dbName;
            protocol.wServer    = (UInt16)_server.Id;
            protocol.szSql      = cmd.SqlBuffer;

            if (!_server.SendMessage(protocol))
            {
                throw new Exception("GameServer.QueryGameServerDb: SendMessage failure.");
            }

            outArg = id;
            return(true);
        }
Beispiel #2
0
		bool Query(ref object outArg, params object[] args)
		{
			if (args == null || args.Length != 2)
				throw new ArgumentException();

			string dbName = args[0] as string;
			SqlCommand cmd = args[1] as SqlCommand;

			uint id = 0;
			lock (_syncRoot)
			{
				id = _queryCount;
				_queryCount++;
			}

			e2g_exesql protocol = new e2g_exesql();
			protocol.nSessionID = id;
			protocol.szDatabase = dbName;
            protocol.wServer = (UInt16)_server.Id;
            protocol.szSql = cmd.SqlBuffer;
            
			if (!_server.SendMessage(protocol))
			{
				throw new Exception("GameServer.QueryGameServerDb: SendMessage failure.");
			}

			outArg = id;
			return true;
		}