<?php

include '/home/minecraft/server/bin/index_wp.php';
// reset all user lots
umc_lot_reset_process();
umc_hardcore_resetworld();
umc_usericon_get();
umc_github_wordpress_update();
function umc_user_get_icon_url($uuid_requested, $update = false)
{
    global $UMC_DOMAIN, $UMC_PATH_MC;
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    if (strstr($uuid_requested, ' ')) {
        return '';
    }
    // make sure it's a uuid
    $uuid = umc_uuid_getone($uuid_requested, 'uuid');
    $path = "{$UMC_PATH_MC}/server/bin/data/user_icons/";
    if (!file_exists($path . $uuid . ".png") && $update) {
        // this tries to download the latest version, otherwise falls back to steve icon
        // umc_update_usericons($uuid);
        umc_usericon_get($uuid);
    } else {
        if (!file_exists($path . $uuid . ".png") && !$update) {
            return false;
        }
    }
    $url = "{$UMC_DOMAIN}/websend/user_icons/{$uuid}.png";
    return $url;
}
Ejemplo n.º 3
0
function umc_ws_eventhandler($event)
{
    global $WS_INIT, $UMC_USER;
    XMPP_ERROR_trace(__FUNCTION__, func_get_args());
    $player = $UMC_USER['username'];
    // iterate all plugins
    foreach ($WS_INIT as $data) {
        // check if there is a setting for the current event
        if ($data['events'] != false && isset($data['events'][$event])) {
            // execute function
            $function = $data['events'][$event];
            if (!is_string($function)) {
                XMPP_ERROR_trigger("plugin eventhandler failed event {$event}");
            }
            // execute the function
            $function();
        }
    }
    // non-plugin events
    switch ($event) {
        case 'PlayerQuitEvent':
            umc_log('system', 'logout', "{$player} logged out");
            umc_uuid_record_usertimes('lastlogout');
            break;
        case 'PlayerJoinEvent':
            umc_uuid_check_usernamechange($UMC_USER['uuid']);
            umc_donation_level($player);
            umc_promote_citizen($player, false);
            umc_log('system', 'login', "{$player} logged in");
            umc_uuid_record_usertimes('lastlogin');
            // check if the user has a skin stored, if not, get it
            umc_usericon_get($UMC_USER['uuid'], false);
            break;
        case 'PlayerPreLoginEvent':
            // nothing needed since the fact that websend is called makes it register the UUID already
            break;
        default:
            // all the events not covered above
            // XMPP_ERROR_send_msg("Event $event not assigned to action (umc_ws_eventhandler)");
    }
}