RIP GOTM
parent
3d57f3d839
commit
b77326eb80
@ -1,76 +0,0 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://Graphics/UI/iosevka-aile-regular.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://Graphics/UI/iosevka-aile-italic.ttf" type="DynamicFontData" id=2]
|
||||
[ext_resource path="res://Graphics/UI/iosevka-aile-bold.ttf" type="DynamicFontData" id=3]
|
||||
[ext_resource path="res://Graphics/UI/iosevka-aile-bolditalic.ttf" type="DynamicFontData" id=4]
|
||||
[ext_resource path="res://Scenes/UI/Panels/Logs.gd" type="Script" id=5]
|
||||
[ext_resource path="res://Scenes/UI/Widgets/ResizablePanel.tscn" type="PackedScene" id=6]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 14
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 14
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
size = 14
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
size = 14
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="Logs" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ResizablePanel" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="ResizablePanel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 10.0
|
||||
margin_top = 40.0
|
||||
margin_right = -10.0
|
||||
margin_bottom = -40.0
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/bold_italics_font = SubResource( 1 )
|
||||
custom_fonts/italics_font = SubResource( 2 )
|
||||
custom_fonts/bold_font = SubResource( 3 )
|
||||
custom_fonts/normal_font = SubResource( 4 )
|
||||
bbcode_enabled = true
|
||||
selection_enabled = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="ResizablePanel"]
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 10.0
|
||||
margin_top = -30.0
|
||||
margin_right = -10.0
|
||||
focus_mode = 1
|
||||
caret_blink = true
|
||||
caret_blink_speed = 0.5
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[connection signal="focus_entered" from="ResizablePanel/LineEdit" to="." method="_chat_bar_status" binds= [ true ]]
|
||||
[connection signal="focus_exited" from="ResizablePanel/LineEdit" to="." method="_chat_bar_status" binds= [ false ]]
|
||||
[connection signal="mouse_entered" from="ResizablePanel/LineEdit" to="." method="_chat_bar_focus" binds= [ true ]]
|
||||
[connection signal="mouse_exited" from="ResizablePanel/LineEdit" to="." method="_chat_bar_focus" binds= [ false ]]
|
@ -1,117 +0,0 @@
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2020-2020 Macaroni Studios AB
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
extends Node
|
||||
#warnings-disable
|
||||
|
||||
|
||||
# Official GDScript API for games on gotm.io
|
||||
# This plugin serves as a polyfill while developing against the API locally.
|
||||
|
||||
# The 'real' API calls are only available when running the game live on gotm.io.
|
||||
# Running the game in the web player (gotm.io/web-player) also counts as live.
|
||||
|
||||
# Add this script as a global autoload. Make sure the global autoload is named
|
||||
# "Gotm". It must be named "Gotm" for it to work.
|
||||
|
||||
|
||||
##############################################################
|
||||
# SIGNALS
|
||||
##############################################################
|
||||
# You connected or disconnected from a lobby. Access it at 'Gotm.lobby'
|
||||
signal lobby_changed()
|
||||
|
||||
# Files were drag'n'dropped into the screen.
|
||||
# The 'files' argument is an array of 'GotmFile'.
|
||||
signal files_dropped(files, screen)
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# PROPERTIES
|
||||
##############################################################
|
||||
# These are all read only.
|
||||
|
||||
# Player information.
|
||||
var user: GotmUser = GotmUser.new()
|
||||
|
||||
# Current lobby you are in.
|
||||
# Is null when not in a lobby.
|
||||
var lobby: GotmLobby = null
|
||||
|
||||
|
||||
##############################################################
|
||||
# METHODS
|
||||
##############################################################
|
||||
|
||||
# The API is live when the game runs on gotm.io.
|
||||
# Running the game in the web player (gotm.io/web-player) also counts as live.
|
||||
func is_live() -> bool:
|
||||
return false
|
||||
|
||||
|
||||
# Create a new lobby and join it.
|
||||
#
|
||||
# If 'show_invitation' is true, show an invitation link in a popup.
|
||||
#
|
||||
# By default, the lobby is hidden and is only accessible directly through
|
||||
# its 'invite_link'.
|
||||
# Set 'lobby.hidden' to false to make it fetchable with 'GotmLobbyFetch'.
|
||||
#
|
||||
# Returns the hosted lobby (also accessible at 'Gotm.lobby').
|
||||
static func host_lobby(show_invitation: bool = true) -> GotmLobby:
|
||||
return _GotmImpl._host_lobby(GotmLobby.new())
|
||||
|
||||
|
||||
# Play an audio snippet with 'message' as a synthesized voice.
|
||||
# 'language' is in BCP 47 format (e.g. "en-US" for american english).
|
||||
# If specified language is not available "en-US" is used.
|
||||
# Return true if playback succeeded.
|
||||
func text_to_speech(message: String, language: String = "en-US") -> bool:
|
||||
return true # pretend it worked
|
||||
|
||||
|
||||
# Asynchronously open up the browser's file picker.
|
||||
#
|
||||
# If 'types' is specified, limit the file picker to files with matching file
|
||||
# types (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers).
|
||||
# If 'only_one' is true, only allow the user to pick one file.
|
||||
#
|
||||
# If a picking-session is already in progress, an empty
|
||||
# array is asynchronously returned.
|
||||
#
|
||||
# Asynchronously return an array of 'GotmFile'.
|
||||
# Use 'yield(pick_files(), "completed")' to retrieve the return value.
|
||||
func pick_files(types: Array = Array(), only_one: bool = false) -> Array:
|
||||
yield(get_tree().create_timer(0.25), "timeout")
|
||||
return []
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# PRIVATE
|
||||
##############################################################
|
||||
func _ready() -> void:
|
||||
_GotmImpl._initialize(GotmLobby, GotmUser)
|
||||
func _process(delta) -> void:
|
||||
_GotmImpl._process()
|
||||
var _impl: Dictionary = {}
|
@ -1,65 +0,0 @@
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2020-2020 Macaroni Studios AB
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
class_name GotmDebug
|
||||
#warnings-disable
|
||||
|
||||
# Helper library for testing against the API locally, as if it would be live.
|
||||
#
|
||||
# These functions do not make real API calls. They fake operations and
|
||||
# trigger relevant signals as if they happened live.
|
||||
#
|
||||
# These functions do nothing when the game is running live on gotm.io.
|
||||
# Running the game in the web player (gotm.io/web-player) also counts as live.
|
||||
|
||||
# Host a lobby without joining it.
|
||||
# Note that the lobby is hidden by default and not fetchable with
|
||||
# 'GotmLobbyFetch'. To make it fetchable, set 'hidden' to false.
|
||||
# The lobby is only fetchable and joinable in this game process.
|
||||
# Returns added lobby.
|
||||
static func add_lobby() -> GotmLobby:
|
||||
return _GotmDebugImpl._add_lobby(GotmLobby.new())
|
||||
|
||||
|
||||
# Remove a lobby created with 'add_lobby', as if its host (you) disconnected from it.
|
||||
# Triggers 'lobby_changed' if you are in that lobby.
|
||||
static func remove_lobby(lobby: GotmLobby) -> void:
|
||||
_GotmDebugImpl._remove_lobby(lobby)
|
||||
|
||||
|
||||
# Remove all lobbies.
|
||||
static func clear_lobbies() -> void:
|
||||
_GotmDebugImpl._clear_lobbies()
|
||||
|
||||
|
||||
# Add yourself to the lobby, without joining it.
|
||||
# Triggers 'peer_joined' if you are in that lobby.
|
||||
# Returns joined peer.
|
||||
static func add_lobby_peer(lobby: GotmLobby) -> GotmUser:
|
||||
return _GotmDebugImpl._add_lobby_player(lobby, GotmUser.new())
|
||||
|
||||
|
||||
# Remove a peer created with 'add_lobby_peer' from the lobby, as if the peer (you) disconnected
|
||||
# from the lobby.
|
||||
# Triggers 'peer_left' if you are in that lobby.
|
||||
static func remove_lobby_peer(lobby: GotmLobby, peer: GotmUser) -> void:
|
||||
_GotmDebugImpl._remove_lobby_player(lobby, peer)
|
@ -1,50 +0,0 @@
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2020-2020 Macaroni Studios AB
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
class_name GotmFile
|
||||
#warnings-disable
|
||||
|
||||
# A simple in-memory file descriptor used by 'Gotm.pick_files' and
|
||||
# 'Gotm.files_dropped'.
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# PROPERTIES
|
||||
##############################################################
|
||||
# File name.
|
||||
var name: String
|
||||
|
||||
# File data.
|
||||
var data: PoolByteArray
|
||||
|
||||
# Last time the file was modified in unix time (seconds since epoch).
|
||||
var modified_time: int
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# METHODS
|
||||
##############################################################
|
||||
# Save the file to the browser's download folder.
|
||||
func download() -> void:
|
||||
pass
|
@ -1,155 +0,0 @@
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2020-2020 Macaroni Studios AB
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
class_name GotmLobby
|
||||
#warnings-disable
|
||||
|
||||
# A lobby is a way of connecting players with eachother as if they
|
||||
# were on the same local network.
|
||||
#
|
||||
# Lobbies can be joined either directly through an 'invite_link', or by
|
||||
# joining lobbies fetched with the 'GotmLobbyFetch' class.
|
||||
|
||||
##############################################################
|
||||
# SIGNALS
|
||||
##############################################################
|
||||
# Peer joined the lobby.
|
||||
# 'peer_user' is a 'GotmUser' instance.
|
||||
# This is only emitted if you are in this lobby.
|
||||
signal peer_joined(peer_user)
|
||||
|
||||
# Peer left the lobby.
|
||||
# 'peer_user' is a 'GotmUser' instance.
|
||||
# This is only emitted if you are in this lobby.
|
||||
signal peer_left(peer_user)
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# READ-ONLY PROPERTIES
|
||||
##############################################################
|
||||
# Globally unique identifier.
|
||||
var id: String
|
||||
|
||||
# Other peers in the lobby with addresses.
|
||||
# Is an array of 'GotmUser'.
|
||||
var peers: Array = []
|
||||
|
||||
# You with address.
|
||||
var me: GotmUser = GotmUser.new()
|
||||
|
||||
# Host user with address.
|
||||
var host: GotmUser = GotmUser.new()
|
||||
|
||||
# Peers can join the lobby directly through this link.
|
||||
var invite_link: String
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# WRITABLE PROPERTIES
|
||||
##############################################################
|
||||
# Note that only the host can write to these properties.
|
||||
|
||||
# Name that is searchable using 'GotmLobbyFetch'
|
||||
# Names longer than 64 characters are truncated.
|
||||
var name: String = ""
|
||||
|
||||
# Prevent the lobby from showing up in fetches?
|
||||
# Peers may still join directly through 'invite_link'
|
||||
var hidden: bool = true
|
||||
|
||||
# Prevent new peers from joining?
|
||||
# Also prevents the lobby from showing up in fetches.
|
||||
var locked: bool = false
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# METHODS
|
||||
##############################################################
|
||||
# Asynchronously join this lobby after leaving current lobby.
|
||||
#
|
||||
# Use 'var success = yield(lobby.join(), "completed")' to wait for the call to complete
|
||||
# and retrieve the return value.
|
||||
#
|
||||
# Sets 'Gotm.lobby' to the joined lobby if successful.
|
||||
#
|
||||
# Asyncronously returns true if successful, else false.
|
||||
func join() -> bool:
|
||||
return yield(_GotmImpl._join_lobby(self), "completed")
|
||||
|
||||
|
||||
# Leave this lobby.
|
||||
func leave() -> void:
|
||||
_GotmImpl._leave_lobby(self)
|
||||
|
||||
|
||||
# Am I the host of this lobby?
|
||||
func is_host() -> bool:
|
||||
return _GotmImpl._is_lobby_host(self)
|
||||
|
||||
|
||||
# Get a custom property.
|
||||
func get_property(name: String):
|
||||
return _GotmImpl._get_lobby_property(self, name)
|
||||
|
||||
|
||||
|
||||
################################
|
||||
# Host-only methods
|
||||
################################
|
||||
# Kick peer from this lobby.
|
||||
# Returns true if successful, else false.
|
||||
func kick(peer: GotmUser) -> bool:
|
||||
return _GotmImpl._kick_lobby_peer(self, peer)
|
||||
|
||||
|
||||
# Store up to 10 of your own custom properties in the lobby.
|
||||
# These are visible to other peers when fetching lobbies.
|
||||
# Only properties of types String, int, float or bool are allowed.
|
||||
# Integers are converted to floats.
|
||||
# Strings longer than 64 characters are truncated.
|
||||
# Setting 'value' to null removes the property.
|
||||
func set_property(name: String, value) -> void:
|
||||
_GotmImpl._set_lobby_property(self, name, value)
|
||||
|
||||
|
||||
# Make this lobby filterable by a custom property.
|
||||
# Filtering is done when fetching lobbies with 'GotmLobbyFetch'.
|
||||
# Up to 3 properties can be set as filterable at once.
|
||||
func set_filterable(property_name: String, filterable: bool = true) -> void:
|
||||
_GotmImpl._set_lobby_filterable(self, property_name, filterable)
|
||||
|
||||
|
||||
# Make this lobby sortable by a custom property.
|
||||
# Sorting is done when fetching lobbies with 'GotmLobbyFetch'.
|
||||
# Up to 3 properties can be set as sortable at once.
|
||||
func set_sortable(property_name: String, sortable: bool = true) -> void:
|
||||
_GotmImpl._set_lobby_sortable(self, property_name, sortable)
|
||||
|
||||
|
||||
|
||||
################################
|
||||
# PRIVATE
|
||||
################################
|
||||
var _impl: Dictionary = {}
|
@ -1,122 +0,0 @@
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2020-2020 Macaroni Studios AB
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
class_name GotmLobbyFetch
|
||||
#warnings-disable
|
||||
|
||||
# Used for fetching non-hidden and non-locked lobbies.
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# PROPERTIES
|
||||
##############################################################
|
||||
################
|
||||
# Filter options
|
||||
################
|
||||
# If not empty, fetch lobbies whose 'Lobby.name' contains 'name'.
|
||||
var filter_name: String = ""
|
||||
|
||||
# If not empty, fetch lobbies whose filterable custom properties
|
||||
# matches those in 'filter_properties'.
|
||||
#
|
||||
# For example, setting 'filter_properties.difficulty = 2' will
|
||||
# only fetch lobbies that have been set up with both 'lobby.set_property("difficulty", 2)'
|
||||
# and 'lobby.set_filterable("difficulty", true)'.
|
||||
#
|
||||
# If your lobby has multiple filterable props, you must provide every filterable
|
||||
# prop in 'filter_properties'. Setting a prop's value to 'null' will match any
|
||||
# value of that prop.
|
||||
var filter_properties: Dictionary = {}
|
||||
|
||||
|
||||
################
|
||||
# Sort options
|
||||
################
|
||||
# If not empty, sort by a sortable custom property.
|
||||
#
|
||||
# For example, setting 'sort_property = "difficulty"' will
|
||||
# only fetch lobbies that have been set up with both 'lobby.set_property("difficulty", some_value)'
|
||||
# and 'lobby.set_sortable("difficulty", true)'.
|
||||
#
|
||||
# If your lobby has a sortable prop, you must always provide a 'sort_property'.
|
||||
var sort_property: String = ""
|
||||
|
||||
# Sort results in ascending order?
|
||||
var sort_ascending: bool = false
|
||||
|
||||
# If not null, fetch lobbies whose sort property's value is equal to or greater than 'sort_min'.
|
||||
var sort_min = null
|
||||
|
||||
# If not null, fetch lobbies whose sort property's value is equal to or lesser than 'sort_max'.
|
||||
var sort_max = null
|
||||
|
||||
# If true, and 'sort_min' is provided, exclude lobbies whose sort property's value is equal to 'sort_min'.
|
||||
var sort_min_exclusive = false
|
||||
|
||||
# If true, and 'sort_max' is provided, exclude lobbies whose sort property's value is equal to 'sort_max'.
|
||||
var sort_max_exclusive = false
|
||||
|
||||
|
||||
|
||||
##############################################################
|
||||
# METHODS
|
||||
##############################################################
|
||||
# All these methods asynchronously fetch up to 8 non-hidden
|
||||
# and non-locked lobbies.
|
||||
#
|
||||
# Modifying any filtering or sorting option resets the state of this
|
||||
# 'GotmLobbyFetch' instance and causes the next fetch call to
|
||||
# fetch the first lobbies.
|
||||
#
|
||||
# All calls asynchronously return an array of fetched lobbies.
|
||||
# Use 'yield(fetch.next(), "completed")' to retrieve it.
|
||||
|
||||
|
||||
# Fetch the next lobbies, starting after the last lobby fetched
|
||||
# in the previous call.
|
||||
func next(count: int = 8) -> Array:
|
||||
return yield(_GotmImpl._fetch_lobbies(self, count, "next"), "completed")
|
||||
|
||||
|
||||
# Fetch the previous lobbies, ending before the first lobby
|
||||
# that was fetched in the previous call.
|
||||
func previous(count: int = 8) -> Array:
|
||||
return yield(_GotmImpl._fetch_lobbies(self, count, "previous"), "completed")
|
||||
|
||||
|
||||
# Fetch the first lobbies.
|
||||
func first(count: int = 8) -> Array:
|
||||
return yield(_GotmImpl._fetch_lobbies(self, count, "first"), "completed")
|
||||
|
||||
|
||||
# Fetch lobbies at the current position.
|
||||
# Useful for refreshing lobbies without changing the page.
|
||||
func current(count: int = 8) -> Array:
|
||||
return yield(_GotmImpl._fetch_lobbies(self, count, "current"), "completed")
|
||||
|
||||
|
||||
|
||||
############################################################## |