Release 0.0.1.8.8.7
This commit is contained in:
1 parent
3c8a17aa78
commit
c7beab414c
16283 files changed
+768761
-2
No files matched your search
@@ -0,0 +1,50 @@
|
||||
module WebSocket
|
||||
# Cleanup world objects on map change/disconnect
|
||||
#--------------------------------------------------------------------------
|
||||
def self.cleanup_world_objects
|
||||
begin
|
||||
@map_drops.keys.each { |did| remove_map_drop(did) }
|
||||
@map_drops.clear
|
||||
clear_pickup_inflight
|
||||
rescue
|
||||
end
|
||||
|
||||
begin
|
||||
@remote_events.keys.each { |seid| remove_remote_event(seid) }
|
||||
@remote_events.clear
|
||||
rescue
|
||||
end
|
||||
|
||||
begin
|
||||
@net_effects.clear
|
||||
rescue
|
||||
end
|
||||
|
||||
begin
|
||||
@npc_owners.clear if @npc_owners
|
||||
rescue
|
||||
end
|
||||
|
||||
begin
|
||||
@remote_static_npc_types.clear if @remote_static_npc_types
|
||||
@static_npc_compatibility.clear if @static_npc_compatibility
|
||||
rescue
|
||||
end
|
||||
end
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Convenience: drop API
|
||||
#--------------------------------------------------------------------------
|
||||
def self.net_drop_item(item_type, item_id, qty, x=nil, y=nil, duration=nil)
|
||||
return unless @connected && @worldsync
|
||||
x ||= $game_player.x
|
||||
y ||= $game_player.y
|
||||
by = (@my_id || 0)
|
||||
|
||||
if duration
|
||||
send_line("drop:#{item_type}:#{item_id.to_i}:#{x.to_i}:#{y.to_i}:#{qty.to_i}:#{by}:#{duration.to_f}")
|
||||
else
|
||||
send_line("drop:#{item_type}:#{item_id.to_i}:#{x.to_i}:#{y.to_i}:#{qty.to_i}:#{by}")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user