mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-03 04:19:20 -04:00
64 lines
1.7 KiB
C++
Executable File
64 lines
1.7 KiB
C++
Executable File
// ======================================================================
|
|
//
|
|
// GetChunkQuery.cpp
|
|
// copyright (c) 2001 Sony Online Entertainment
|
|
//
|
|
// ======================================================================
|
|
|
|
#include "serverDatabase/FirstServerDatabase.h"
|
|
#include "serverDatabase/GetChunkQuery.h"
|
|
|
|
#include "serverDatabase/DatabaseProcess.h"
|
|
|
|
using namespace DBQuery;
|
|
|
|
// ======================================================================
|
|
|
|
GetChunkQuery::GetChunkQuery(const std::string &schema) :
|
|
m_schema(schema)
|
|
{
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void GetChunkQuery::setChunk(const std::string &sceneId, int nodeX, int nodeZ)
|
|
{
|
|
scene_id.setValue(sceneId);
|
|
node_x.setValue(nodeX);
|
|
node_z.setValue(nodeZ);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
DB::Query::QueryMode GetChunkQuery::getExecutionMode() const
|
|
{
|
|
return (MODE_PROCEXEC);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void GetChunkQuery::getSQL(std::string &sql)
|
|
{
|
|
sql=std::string("begin :object_count := ") + m_schema + "loader.load_chunk_object_list (:scene_id, :node_x, :node_z); end;";
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool GetChunkQuery::bindParameters()
|
|
{
|
|
if (!bindParameter(object_count)) return false;
|
|
if (!bindParameter(scene_id)) return false;
|
|
if (!bindParameter(node_x)) return false;
|
|
if (!bindParameter(node_z)) return false;
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
bool GetChunkQuery::bindColumns()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ======================================================================
|