Tg port 2 15 (#230)

* defines/helpers

* globalvars, onclick, controllers

* datums and game

* woooooooooorld. Uh. dm

* modules sans mobs client admin

* modules/admin

* pref shit

* modules/mob

* icon updates

* extra things

* Cherrypicked fixes from open PRs

* metastation.tgm fix

* a better meta fix

* reverts async breakings
This commit is contained in:
Poojawa
2017-02-15 03:35:32 -06:00
committed by GitHub
parent fd3923d684
commit fc2dbcd9fe
192 changed files with 10451 additions and 160669 deletions
+7 -6
View File
@@ -131,7 +131,7 @@ function handle_pr($payload) {
}
$msg = 'Pull Request '.$action.' by '.htmlSpecialChars($payload['sender']['login']).': <a href="'.$payload['pull_request']['html_url'].'">'.htmlSpecialChars('#'.$payload['pull_request']['number'].' '.$payload['pull_request']['user']['login'].' - '.$payload['pull_request']['title']).'</a>';
sendtoallservers('?announce='.urlencode($msg));
sendtoallservers('?announce='.urlencode($msg), $payload);
}
@@ -278,14 +278,15 @@ function checkchangelog($payload, $merge = false) {
echo file_get_contents($payload['pull_request']['base']['repo']['url'].'/contents'.$filename, false, stream_context_create($scontext));
}
function sendtoallservers($str) {
function sendtoallservers($str, $payload = null) {
global $servers;
foreach ($servers as $serverid => $server) {
if (isset($server['comskey']))
$rtn = export($server['address'], $server['port'], $str.'&key='.$server['comskey']);
else
$rtn = export($server['address'], $server['port'], $str);
$str .= '&key='.urlencode($server['comskey']);
if (!empty($payload))
$str .= '&payload='.urlencode(json_encode($payload));
$rtn = export($server['address'], $server['port'], $str);
echo "Server Number $serverid replied: $rtn\n";
}
}
+2 -2
View File
@@ -121,7 +121,7 @@ def merge_map(newfile, backupfile, tgm):
#######################
#write to file helpers#
def write_dictionary_tgm(filename, dictionary, header): #write dictionary in tgm format
def write_dictionary_tgm(filename, dictionary, header = None): #write dictionary in tgm format
with open(filename, "w") as output:
output.write("{}\n".format(tgm_header))
if header:
@@ -179,7 +179,7 @@ def write_grid_coord_small(filename, grid, maxx, maxy): #thanks to YotaXP for fi
output.write("{}\n\"}}\n".format(grid[x,maxy]))
def write_dictionary(filename, dictionary, header): #writes a tile dictionary the same way Dreammaker does
def write_dictionary(filename, dictionary, header = None): #writes a tile dictionary the same way Dreammaker does
with open(filename, "w") as output:
for key, value in dictionary.items():
if header: