mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
New stuff actually compiles now
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1150 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
f7a0c180d8
commit
2eafeefbb1
@ -220,13 +220,13 @@ class ModuleSQL : public Module
|
||||
{
|
||||
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
|
||||
{
|
||||
if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
|
||||
if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
|
||||
{
|
||||
bool xr = i->QueryResult(r->GetQuery());
|
||||
if (!xr)
|
||||
{
|
||||
res->SetType(SQL_ERROR);
|
||||
res->SetError(r->GetError());
|
||||
res->SetError(i->GetError());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -237,7 +237,7 @@ class ModuleSQL : public Module
|
||||
{
|
||||
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
|
||||
{
|
||||
if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
|
||||
if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
|
||||
{
|
||||
res->SetType(SQL_COUNT);
|
||||
res->SetCount(i->QueryCount(r->GetQuery()));
|
||||
@ -250,7 +250,7 @@ class ModuleSQL : public Module
|
||||
{
|
||||
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
|
||||
{
|
||||
if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
|
||||
if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
|
||||
{
|
||||
std::map<std::string,std::string> row = i->GetRow();
|
||||
res->SetRow(row);
|
||||
@ -264,21 +264,25 @@ class ModuleSQL : public Module
|
||||
|
||||
char* OnRequest(Request* request)
|
||||
{
|
||||
SQLResult Result = new SQLResult();
|
||||
SQLRequest *r = (SQLRequest*)request;
|
||||
switch (r->GetRequest())
|
||||
if (request)
|
||||
{
|
||||
case SQL_RESULT:
|
||||
ResultType(r,Result);
|
||||
break;
|
||||
case SQL_COUNT:
|
||||
CountType(r,Result);
|
||||
break;
|
||||
case SQL_ROW:
|
||||
RowType(r,Result);
|
||||
break;
|
||||
SQLResult* Result = new SQLResult();
|
||||
SQLRequest *r = (SQLRequest*)request->GetData();
|
||||
switch (r->GetQueryType())
|
||||
{
|
||||
case SQL_RESULT:
|
||||
ResultType(r,Result);
|
||||
break;
|
||||
case SQL_COUNT:
|
||||
CountType(r,Result);
|
||||
break;
|
||||
case SQL_ROW:
|
||||
RowType(r,Result);
|
||||
break;
|
||||
}
|
||||
return (char*)Result;
|
||||
}
|
||||
return Result;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ModuleSQL()
|
||||
|
@ -14,7 +14,7 @@
|
||||
// so that we can neatly pass information around the
|
||||
// system.
|
||||
|
||||
class SQLRequest : public Request
|
||||
class SQLRequest
|
||||
{
|
||||
protected:
|
||||
long conn_id;
|
||||
@ -26,7 +26,7 @@ class SQLRequest : public Request
|
||||
conn_id = id;
|
||||
}
|
||||
|
||||
long GetConnID(long id)
|
||||
long GetConnID()
|
||||
{
|
||||
return conn_id;
|
||||
}
|
||||
@ -36,7 +36,7 @@ class SQLRequest : public Request
|
||||
request_type = t;
|
||||
}
|
||||
|
||||
int GetQueryType(int t)
|
||||
int GetQueryType()
|
||||
{
|
||||
return request_type;
|
||||
}
|
||||
@ -54,7 +54,7 @@ class SQLRequest : public Request
|
||||
|
||||
// Upon completion, an SQLRequest returns an SQLResponse.
|
||||
|
||||
class SQLResponse
|
||||
class SQLResult
|
||||
{
|
||||
protected:
|
||||
int resptype;
|
||||
@ -86,7 +86,7 @@ class SQLResponse
|
||||
|
||||
int GetType()
|
||||
{
|
||||
return restype;
|
||||
return resptype;
|
||||
}
|
||||
|
||||
std::string GetError()
|
||||
|
Loading…
x
Reference in New Issue
Block a user