Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #769 - Replace Variant Autoloader #770

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7484252
less unnecessary and excessive capitalization
Nescio0 May 12, 2021
da2affb
less unnecessary and excessive capitalization
Nescio0 May 12, 2021
1c114ed
Test commit
kestasjk Nov 8, 2021
88d4493
Merge pull request #735 from kestasjk/staging
kestasjk Dec 14, 2021
a364692
Merge pull request #736 from kestasjk/staging
kestasjk Dec 14, 2021
f2ef536
Merge pull request #737 from kestasjk/staging
kestasjk Dec 15, 2021
a7a0400
Bug fixes to remove clutter from error logs
kestasjk Dec 18, 2021
d3eb053
Merge branch 'master' of https://github.com/kestasjk/webDiplomacy int…
kestasjk Dec 18, 2021
ca028ed
Locking fix for map, to prevent deadlocks
kestasjk Dec 18, 2021
4fa5135
Merge pull request #730 from Nescio0/patch-2
kestasjk Jan 13, 2022
70d9060
Return timeSent in api + minor fixes
c-flaherty Jan 6, 2022
be17dfe
Merge pull request #746 from adamlerer/return_timesent_for_message_api
kestasjk Feb 8, 2022
e4ba822
Updated the PayPal donation button target
kestasjk Feb 12, 2022
1110a81
Changed donation link to embed userid
kestasjk Feb 12, 2022
309f39d
Thank you splash page
kestasjk Feb 12, 2022
9c2bdc3
Paypal donation registration to auto track donors
kestasjk Feb 12, 2022
04a7640
Fix for missing bracket
kestasjk Feb 12, 2022
00b4287
Added a new install guide and donation recording
kestasjk Feb 12, 2022
73013a7
Added a new install guide and donation recording
kestasjk Feb 12, 2022
80e39f6
Updated version to 1.68
kestasjk Feb 12, 2022
11db01a
Added missing table to 1.68 script
kestasjk Feb 12, 2022
6f92992
Added missing table to full install script
kestasjk Feb 12, 2022
74866de
Fix fullInstall.sql
Alby1987 Mar 8, 2022
5b0f5a9
Merge pull request #753 from Alby1987/Fix-fullInstall.sql
kestasjk Mar 8, 2022
65b1a98
Fixes #769 - Use `spl_autoload_register` instead of the deprecated `_…
JimMackin Apr 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ webDiplomacy lets you play Diplomacy online.

---

README.txt - Installation information.
install/README.txt - Installation information.

AGPL.txt - The license webDiplomacy is distributed under.

Expand All @@ -23,8 +23,6 @@ When writing the text of your pull request, please include:
* The details of the testing that you've performed
* The github issue number that this pull request is a fix for

Any questions, please email [email protected], and a member of the dev team will answer.

---

If you get errors for files within /javascript/ it is because some default Apache configurations use this as a shared folder by default. Disable this alias to resolve.
Expand All @@ -35,8 +33,6 @@ http://webdiplomacy.net/ - The official webDiplomacy server.

https://github.com/kestasjk/webDiplomacy - The webDiplomacy github source repository.

http://sourceforge.net/projects/phpdiplomacy - The webDiplomacy Sourceforge project page.

---

Kestas J. Kuliukas - [email protected]
199 changes: 0 additions & 199 deletions README.txt

This file was deleted.

9 changes: 5 additions & 4 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,17 +673,18 @@ public function run($userID, $permissionIsExplicit) {
throw new ClientForbiddenException('User does not have explicit permission to make this API call.');
}

if ($toCountryID < 1 || $toCountryID > count($game->Members) || $toCountryID == $countryID) {
if ($toCountryID < 1 || $toCountryID > count($game->Members->ByUserID) || $toCountryID == $countryID) {
throw new RequestException('Invalid toCountryID');
}

$toUser = new User($game->Members->ByCountryID[$toCountryID]->userID);
if(!$toUser->isCountryMuted($game->id, $countryID)) {
libGameMessage::send($toCountryID, $countryID, $message);
$time = libGameMessage::send($toCountryID, $countryID, $message);
}

// FIXME: what to return?
return json_encode($args);
$DB->sql_put("COMMIT");

return $time;
}
}

Expand Down
3 changes: 2 additions & 1 deletion api/responses/game_state.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,15 @@ function load()
// messages
if ($this->pressType != 'NoPress') {
$msgTabl = $DB->sql_tabl(
"SELECT turn, fromCountryID, toCountryID, message, phaseMarker from wD_GameMessages_Redacted WHERE gameID = ".$this->gameID." AND (fromCountryID = ".$this->countryID." OR toCountryID = ".$this->countryID.") ORDER BY timeSent"
"SELECT turn, fromCountryID, toCountryID, message, timeSent, phaseMarker from wD_GameMessages_Redacted WHERE gameID = ".$this->gameID." AND (fromCountryID = ".$this->countryID." OR toCountryID = ".$this->countryID.") ORDER BY timeSent"
);

while ($row = $DB->tabl_hash($msgTabl)) {
$message = new \webdiplomacy_api\Message(
$row['message'],
$row['fromCountryID'],
$row['toCountryID'],
$row['timeSent'],
$row['phaseMarker']
);
$phase = $gameSteps->get($row['turn'], 'Diplomacy', array());
Expand Down
5 changes: 4 additions & 1 deletion api/responses/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Message {
public $message;
public $fromCountryID;
public $toCountryID;
public $timeSent;
public $phaseMarker;

function toJson() { return json_encode($this); }
Expand All @@ -38,14 +39,16 @@ function toJson() { return json_encode($this); }
* @param string $message - message
* @param int $fromCountryID - sender country ID
* @param int $toCountryID - receiver country ID
* @param int $timeSent - time sent
* @param string $phaseMarker - Diplomacy/Retreat/Builds/etc

*/
function __construct($message, $fromCountryID, $toCountryID, $phaseMarker = null)
function __construct($message, $fromCountryID, $toCountryID, $timeSent, $phaseMarker = null)
{
$this->message = $message;
$this->fromCountryID = intval($fromCountryID);
$this->toCountryID = intval($toCountryID);
$this->timeSent = intval($timeSent);
$this->phaseMarker = $phaseMarker;
}
}
7 changes: 5 additions & 2 deletions board.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,11 @@
// Post messages we sent, and get the user we're speaking to
$msgCountryID = $CB->findTab();

$CB->postMessage($msgCountryID);
$DB->sql_put("COMMIT");
if( isset($Member) )
{
$CB->postMessage($msgCountryID);
$DB->sql_put("COMMIT");
}

$forum = $CB->output($msgCountryID);

Expand Down
Loading