This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/alliance/library/getTechOrder.inc

36 lines
982 B
PHP

<?php
//-----------------------------------------------------------------------
// LegacyWorlds Beta 5
// Game libraries
//
// beta5/alliance/library/getTechOrder.inc
//
// This function retrieves technology trading orders from the database.
// Depending on the $send parameter, it can fetch either orders to send
// technologies or orders to receive technologies.
//
// Copyright(C) 2004-2008, DeepClone Development
//-----------------------------------------------------------------------
class beta5_alliance_getTechOrder {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
public function run($player, $send) {
$q = $this->db->query(
"SELECT tech, " . ($send ? "send_to" : "player") . ", submitted, obeyed FROM tech_trade_order "
. "WHERE " . ($send ? "player" : "send_to") . " = $player "
. "FOR UPDATE"
);
if (!dbCount($q)) {
return array(null, null, null, null);
}
return dbFetchArray($q);
}
}
?>