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

Fix compiler warnings in newer builds #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions LocalPackages/BungeeCord/auto_include.ms
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
proc(_writeUTF, @ba, @str,
proc _writeUTF(@ba, @str) {
@len = length(@str)
if (@len > 200) {
die('String too long')
}
ba_put_byte(@ba, 0)
ba_put_byte(@ba, @len)
ba_put_bytes(@ba, string_get_bytes(@str, 'ascii'))
)
}

proc(_changeserver, @player, @server,
proc _changeserver(@player, @server) {
@ba = byte_array()
_writeUTF(@ba, 'Connect')
_writeUTF(@ba, @server)

@servers = array('creative', 'pve', 'minigames', 'lobby')
if (array_contains(@servers, to_lower(@server)) && to_lower(@server) != import('sharedata.source'),
unbind('bc-'.@player)
bind(player_quit, array(priority: normal, id: 'bc-'.@player), array(player: @player), @event, @server,
bind('player_quit', array(priority: 'normal', id: 'bc-'.@player), array(player: @player), @event, @server,
modify_event('message', color(yellow). @event['player'] . ' has switched to ' . @server)
unbind()
)
)
send_plugin_message(@player, 'BungeeCord', @ba)
)
}

proc(_sendPluginMessage, @player, @channel, @messages,
proc _sendPluginMessage(@player, @channel, @messages) {
if (@player != '~console') {
@ba = byte_array()
foreach (@messages, @message,
_writeUTF(@ba, @message)
)
send_plugin_message(@player, @channel, @ba)
}
)
}

@mcb_tab_completer = closure(@alias, @sender, @args){
@res = array();
Expand Down
6 changes: 3 additions & 3 deletions LocalPackages/CHMail2/auto_include.ms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Retrieves the player's uuid from the mail database, or null if no player is known with that username
*/
proc(_mail_get_puuid, @playerName){
proc _mail_get_puuid(@playerName){
@res = query('mail', 'SELECT uuid FROM user WHERE last_username=? LIMIT 1', to_lower(@playerName));
if(length(@res) == 0){
return(null);
Expand All @@ -14,7 +14,7 @@ proc(_mail_get_puuid, @playerName){
/**
* Gets the last known username from the mail database, or null, if no player is known with that uuid
*/
proc(_mail_get_username_from_uuid, @uuid){
proc _mail_get_username_from_uuid(@uuid){
@res = query('mail', 'SELECT last_username FROM user WHERE uuid=?', @uuid);
if(length(@res) == 0){
return(null);
Expand All @@ -26,7 +26,7 @@ proc(_mail_get_username_from_uuid, @uuid){
/**
* Gets the last known display name from the mail database, or null, if no player is known with that uuid
*/
proc(_mail_get_display_name_from_uuid, @uuid){
proc _mail_get_display_name_from_uuid(@uuid){
@res = query('mail', 'SELECT last_display_name FROM user WHERE uuid=?', @uuid);
if(length(@res) == 0){
return(null);
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/CHMail2/main.ms
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


bind(player_join, null, null, @event){
bind('player_join', null, null, @event){
x_new_thread('mail_player_join', closure(){
// Sleep, so they are fully joined before we get their id.
sleep(1);
Expand Down
20 changes: 10 additions & 10 deletions LocalPackages/CHMarquee/auto_include.ms
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

proc(_init_marquee, @name,
proc _init_marquee(@name) {
if(!has_value('chmarquee.list')){
store_value('chmarquee.list', array())
}
Expand All @@ -8,18 +8,18 @@ proc(_init_marquee, @name,
array_push(@list, @name)
store_value('chmarquee.list', @list)
}
)
}

proc(_check_marquee, @name,
proc _check_marquee(@name) {
assign(@value, get_value('chmarquee.list'))
if(!is_array(@value) || !array_contains(@value, @name)){
return(false)
} else {
return(true)
}
)
}

proc(_start_marquee, @name,
proc _start_marquee(@name) {
#Stop the marquee if it's already started
marquee_stop(@name)
msg('Starting \''.@name.'\' marquee.')
Expand Down Expand Up @@ -58,19 +58,19 @@ proc(_start_marquee, @name,
_stop_marquee(@name)
)
))
)
}

proc(_stop_marquee, @name,
proc _stop_marquee(@name) {
marquee_stop(@name)
)
}

proc(_remove_marquee, @name,
proc _remove_marquee(@name) {
_stop_marquee(@name)
assign(@list, get_value('chmarquee.list'))
array_remove_values(@list, @name)
store_value('chmarquee.list', @list)
foreach(array_keys(get_values('chmarquee.' . @name)), @key,
clear_value(@key)
)
)
}

2 changes: 1 addition & 1 deletion LocalPackages/Chaos/suppress_death_messages.ms
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

bind(player_death, null, null, @e,
bind('player_death', null, null, @e,
if(get_value('supress_death_messages')){
console('Death message suppressed: ' . @e['death_message'])
modify_event('death_message', null)
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/ItemFrameMapBan/main.ms
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Lol, I love one liners
bind(player_interact_entity, null, null, @event,
bind('player_interact_entity', null, null, @event,
if(@event['clicked'] == 'ITEM_FRAME'
&& pinv(player(), null) != null
&& (pinv(player(), null)['type'] == 395
Expand Down
4 changes: 2 additions & 2 deletions LocalPackages/SessionTracker/main.ms
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
bind(player_join, null, null, @event,
bind('player_join', null, null, @event,
@session_number=get_value('session_number.'.player())+1
store_value('session_number.'.player(), @session_number)
store_value('session_start.'.player(), time())
)

bind(player_quit, null, null, @event,
bind('player_quit', null, null, @event,
@session_number=get_value('session_number.'.player())
@session_start=get_value('session_start.'.player())
console('SessionTracker: '.player().','.@session_number.','.@session_start.','.(time()-@session_start))
Expand Down
8 changes: 4 additions & 4 deletions LocalPackages/ShareData/auto_include.ms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Stores a global shared value among the servers.
*/
proc(_store_shared_value, @value,
proc _store_shared_value(@value) {
@source = import('sharedata.source')
@data = get_value('sharedata.data')
if(!is_array(@data)){
Expand All @@ -11,13 +11,13 @@ proc(_store_shared_value, @value,
@piece = array(timestamp: time(), source: @source, data: @value)
array_push(@data, @piece)
store_value('sharedata.data', @data)
)
}

proc(_bind_shared_value, @closure,
proc _bind_shared_value(@closure) {
@binds = import('sharedata.binds')
if(!is_array(@binds)){
@binds = array()
}
array_push(@binds, @closure)
export('sharedata.binds', @binds)
)
}
12 changes: 6 additions & 6 deletions LocalPackages/creative-only/auto_include.ms
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

proc(_ermagerd, @string,
proc _ermagerd(@string) {
# Begin the transformations
@string = reg_replace('(?i)oo?r?', 'er', @string)
@string = reg_replace('a', 'er', @string)
Expand All @@ -8,9 +8,9 @@ proc(_ermagerd, @string,
@string = reg_replace('([^a-zA-Z])*?my', '$1ma', @string)
@string = reg_replace('[\\.,;]', '', @string) #Pfft, who needs punctuation
return(@string)
)
}

proc(_effecthelp,
proc _effecthelp() {
_assertperm('effect');
msg(color(GOLD) . 'Usage:');
msg(color(YELLOW) . '/effect clear ' . color(GOLD) . '- Clear all potion effects.');
Expand All @@ -21,7 +21,7 @@ proc(_effecthelp,
msg(color(GOLD) . ' <amplifier> - potion strength; 1, 2 etc.');
msg(color(GOLD) . ' <hide-particles> - if true, hide particles');
return (null);
)
}

// Check the cooldown time of a command.
//
Expand All @@ -32,7 +32,7 @@ proc(_effecthelp,
//
// returns: true if the cooldown is okay, or false if the timer is still
// running.
proc(_checkCooldown, @commandName, @delay,
proc _checkCooldown(@commandName, @delay) {
@varName = "cooldown." . @commandName . "." . player();
@cooldownTime = import(@varName);
@currentTime = time();
Expand All @@ -41,5 +41,5 @@ proc(_checkCooldown, @commandName, @delay,
}
export(@varName, @currentTime + @delay);
return(true);
)
}

2 changes: 1 addition & 1 deletion LocalPackages/creative-only/suppress_death_messages.ms
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

bind(player_death, null, null, @e,
bind('player_death', null, null, @e,
if(get_value('supress_death_messages')){
console('Death message suppressed: ' . @e['death_message'])
modify_event('death_message', null)
Expand Down
28 changes: 14 additions & 14 deletions LocalPackages/games/koth.ms
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Return the team ID (0 - 15) of the current King of the Hill - the team who has
# placed their block in the scoring location. Return -1 if nobody holds that block.

proc(_koth_king,
proc _koth_king() {
@location = get_value('koth.location')
if (!is_null(@location)) {
@block = get_block_at(@location)
Expand All @@ -15,42 +15,42 @@ proc(_koth_king,
}
}
return (-1)
)
}


# _koth_score_get()
#
# Get the array of scores, which are the number of seconds that each team (0 - 15)
# has held the scoring block.

proc(_koth_score_get,
proc _koth_score_get() {
@times = get_value('koth.times')
if (is_null(@times)) {
@times = array()
array_resize(@times, 16, 0)
}
return (@times)
)
}


# _koth_score_clear()
#
# Reset the accumulated time (score) for all teams to 0.
# Return the initialised times array.

proc(_koth_score_clear,
proc _koth_score_clear() {
@times = array()
array_resize(@times, 16, 0)
store_value('koth.times', @times)
return (@times)
)
}


# _koth_score_show()
#
# Show the current score.

proc(_koth_score_show,
proc _koth_score_show() {
# The chat color corresponding to a particular team ID (wool data value) from 0 - 15.
@COLOR = array(
color(WHITE), color(GOLD), color(LIGHT_PURPLE), color(BLUE),
Expand All @@ -75,35 +75,35 @@ proc(_koth_score_show,
}
)
msg(@message)
)
}


# _koth_reset()
#
# Clear the accumulated scores.
# If a team block (wool) is at the scoring location, set that block to air.

proc(_koth_reset,
proc _koth_reset() {
_koth_score_clear()
@team = _koth_king()
if (@team >= 0) {
# If there is a King, the location is valid.
@location = get_value('koth.location')
set_block_at(@location, 0)
}
)
}


# _koth_stop()
#
# Stop the scorekeeping task.

proc(_koth_stop,
proc _koth_stop() {
@task = get_value('koth.task')
if (! is_null(@task)) {
clear_task(@task)
}
)
}


# _koth_start()
Expand All @@ -112,7 +112,7 @@ proc(_koth_stop,
# the 'koth.block' location. Add to the score of whichever team has their
# wool colour there.

proc(_koth_start,
proc _koth_start() {
# Period between checks in seconds.
@CHECK_PERIOD = 1

Expand All @@ -126,4 +126,4 @@ proc(_koth_start,
}
))
store_value('koth.task', @task)
)
}
8 changes: 4 additions & 4 deletions LocalPackages/global/EasySigns/auto_include.ms
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# if the arguments could not be parsed.
# @args can be an array slice created with @args[cslice(first, last)].

proc(_parse_location, @args,
proc _parse_location(@args) {
if (array_size(@args) != 3 && array_size(@args) != 4) {
return ('The location must be of the form [<world>] <x> <y> <z>.')
}
Expand All @@ -29,16 +29,16 @@ proc(_parse_location, @args,
}

return (array(@args[@start], @args[@start+1], @args[@start+2], @world))
)
}

/**
* Changes the location array's new format into the old, expected format.
*/
proc(_easy_sign_loc_conv, @location,
proc _easy_sign_loc_conv(@location) {
@array = array()
@array[] = integer(@location['x'])
@array[] = integer(@location['y'])
@array[] = integer(@location['z'])
@array[] = @location['world']
return(@array)
)
}
Loading