@netifyjs/protocol 0.0.0-stage → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -2
- package/package.json +56 -4
- package/src/codec/index.ts +256 -0
- package/src/dispatch/dispatcher/index.ts +200 -0
- package/src/dispatch/event/index.ts +49 -0
- package/src/dispatch/index.ts +11 -0
- package/src/dispatch/route/index.ts +141 -0
- package/src/dispatch/session/index.ts +60 -0
- package/src/format/index.ts +72 -0
- package/src/index.ts +66 -0
- package/src/names/index.ts +73 -0
- package/src/photon/application/index.ts +76 -0
- package/src/photon/authentication/admission/index.ts +47 -0
- package/src/photon/authentication/authenticator/index.ts +106 -0
- package/src/photon/authentication/failure/index.ts +15 -0
- package/src/photon/authentication/gate/index.ts +221 -0
- package/src/photon/authentication/http/index.ts +337 -0
- package/src/photon/authentication/index.ts +18 -0
- package/src/photon/authentication/keys/index.ts +67 -0
- package/src/photon/authentication/provider/index.ts +48 -0
- package/src/photon/authentication/queue/index.ts +284 -0
- package/src/photon/authentication/result/index.ts +191 -0
- package/src/photon/balancing/catalogue/events/index.ts +93 -0
- package/src/photon/balancing/catalogue/index.ts +148 -0
- package/src/photon/balancing/catalogue/requests/index.ts +104 -0
- package/src/photon/balancing/catalogue/responses/index.ts +106 -0
- package/src/photon/balancing/code/actor/index.ts +24 -0
- package/src/photon/balancing/code/authentication/index.ts +101 -0
- package/src/photon/balancing/code/caching/index.ts +69 -0
- package/src/photon/balancing/code/cause/index.ts +115 -0
- package/src/photon/balancing/code/error/index.ts +280 -0
- package/src/photon/balancing/code/event/index.ts +104 -0
- package/src/photon/balancing/code/friends/index.ts +35 -0
- package/src/photon/balancing/code/game/index.ts +69 -0
- package/src/photon/balancing/code/index.ts +52 -0
- package/src/photon/balancing/code/join/index.ts +29 -0
- package/src/photon/balancing/code/lobby/index.ts +29 -0
- package/src/photon/balancing/code/matchmaking/index.ts +25 -0
- package/src/photon/balancing/code/message/index.ts +507 -0
- package/src/photon/balancing/code/operation/index.ts +124 -0
- package/src/photon/balancing/code/parameter/index.ts +414 -0
- package/src/photon/balancing/code/ping/index.ts +29 -0
- package/src/photon/balancing/code/port/index.ts +89 -0
- package/src/photon/balancing/code/property/index.ts +30 -0
- package/src/photon/balancing/code/receiver/index.ts +24 -0
- package/src/photon/balancing/code/room/index.ts +45 -0
- package/src/photon/balancing/code/state/index.ts +109 -0
- package/src/photon/balancing/code/status/index.ts +89 -0
- package/src/photon/balancing/code/web/index.ts +29 -0
- package/src/photon/balancing/codec/index.ts +294 -0
- package/src/photon/balancing/dotnet/index.ts +55 -0
- package/src/photon/balancing/entity/authentication/index.ts +51 -0
- package/src/photon/balancing/entity/credentials/index.ts +77 -0
- package/src/photon/balancing/entity/entry/index.ts +77 -0
- package/src/photon/balancing/entity/grant/index.ts +192 -0
- package/src/photon/balancing/entity/index.ts +7 -0
- package/src/photon/balancing/entity/lobby/index.ts +35 -0
- package/src/photon/balancing/entity/options/index.ts +174 -0
- package/src/photon/balancing/entity/stat/index.ts +59 -0
- package/src/photon/balancing/format/authenticate/index.ts +2 -0
- package/src/photon/balancing/format/authenticate/request/index.ts +82 -0
- package/src/photon/balancing/format/authenticate/response/index.ts +61 -0
- package/src/photon/balancing/format/contract/index.ts +51 -0
- package/src/photon/balancing/format/event/auth/index.ts +49 -0
- package/src/photon/balancing/format/event/azure/index.ts +56 -0
- package/src/photon/balancing/format/event/custom/index.ts +55 -0
- package/src/photon/balancing/format/event/disconnect/index.ts +54 -0
- package/src/photon/balancing/format/event/error/index.ts +51 -0
- package/src/photon/balancing/format/event/index.ts +16 -0
- package/src/photon/balancing/format/event/join/index.ts +58 -0
- package/src/photon/balancing/format/event/leave/index.ts +60 -0
- package/src/photon/balancing/format/event/list/index.ts +53 -0
- package/src/photon/balancing/format/event/match/index.ts +55 -0
- package/src/photon/balancing/format/event/offline/index.ts +52 -0
- package/src/photon/balancing/format/event/properties/index.ts +60 -0
- package/src/photon/balancing/format/event/purged/index.ts +44 -0
- package/src/photon/balancing/format/event/queue/index.ts +51 -0
- package/src/photon/balancing/format/event/slice/index.ts +57 -0
- package/src/photon/balancing/format/event/stats/app/index.ts +60 -0
- package/src/photon/balancing/format/event/stats/index.ts +2 -0
- package/src/photon/balancing/format/event/stats/lobby/index.ts +54 -0
- package/src/photon/balancing/format/event/update/index.ts +53 -0
- package/src/photon/balancing/format/friends/index.ts +2 -0
- package/src/photon/balancing/format/friends/request/index.ts +56 -0
- package/src/photon/balancing/format/friends/response/index.ts +64 -0
- package/src/photon/balancing/format/game/create/index.ts +2 -0
- package/src/photon/balancing/format/game/create/request/index.ts +79 -0
- package/src/photon/balancing/format/game/create/response/index.ts +87 -0
- package/src/photon/balancing/format/game/debug/index.ts +2 -0
- package/src/photon/balancing/format/game/debug/request/index.ts +55 -0
- package/src/photon/balancing/format/game/debug/response/index.ts +60 -0
- package/src/photon/balancing/format/game/index.ts +17 -0
- package/src/photon/balancing/format/game/join/index.ts +2 -0
- package/src/photon/balancing/format/game/join/request/index.ts +93 -0
- package/src/photon/balancing/format/game/join/response/index.ts +87 -0
- package/src/photon/balancing/format/game/list/index.ts +2 -0
- package/src/photon/balancing/format/game/list/request/index.ts +59 -0
- package/src/photon/balancing/format/game/list/response/index.ts +57 -0
- package/src/photon/balancing/format/game/random/index.ts +2 -0
- package/src/photon/balancing/format/game/random/request/index.ts +87 -0
- package/src/photon/balancing/format/game/random/response/index.ts +66 -0
- package/src/photon/balancing/format/groups/index.ts +2 -0
- package/src/photon/balancing/format/groups/request/index.ts +54 -0
- package/src/photon/balancing/format/groups/response/index.ts +52 -0
- package/src/photon/balancing/format/index.ts +88 -0
- package/src/photon/balancing/format/leave/index.ts +2 -0
- package/src/photon/balancing/format/leave/request/index.ts +54 -0
- package/src/photon/balancing/format/leave/response/index.ts +49 -0
- package/src/photon/balancing/format/lobby/index.ts +12 -0
- package/src/photon/balancing/format/lobby/join/index.ts +2 -0
- package/src/photon/balancing/format/lobby/join/request/index.ts +63 -0
- package/src/photon/balancing/format/lobby/join/response/index.ts +45 -0
- package/src/photon/balancing/format/lobby/leave/index.ts +2 -0
- package/src/photon/balancing/format/lobby/leave/request/index.ts +43 -0
- package/src/photon/balancing/format/lobby/leave/response/index.ts +45 -0
- package/src/photon/balancing/format/lobby/stats/index.ts +2 -0
- package/src/photon/balancing/format/lobby/stats/request/index.ts +54 -0
- package/src/photon/balancing/format/lobby/stats/response/index.ts +62 -0
- package/src/photon/balancing/format/once/index.ts +2 -0
- package/src/photon/balancing/format/once/request/index.ts +72 -0
- package/src/photon/balancing/format/once/response/index.ts +65 -0
- package/src/photon/balancing/format/ping/index.ts +2 -0
- package/src/photon/balancing/format/ping/request/index.ts +43 -0
- package/src/photon/balancing/format/ping/response/index.ts +49 -0
- package/src/photon/balancing/format/properties/get/index.ts +2 -0
- package/src/photon/balancing/format/properties/get/request/index.ts +58 -0
- package/src/photon/balancing/format/properties/get/response/index.ts +62 -0
- package/src/photon/balancing/format/properties/index.ts +8 -0
- package/src/photon/balancing/format/properties/set/index.ts +2 -0
- package/src/photon/balancing/format/properties/set/request/index.ts +66 -0
- package/src/photon/balancing/format/properties/set/response/index.ts +53 -0
- package/src/photon/balancing/format/raise/index.ts +2 -0
- package/src/photon/balancing/format/raise/request/index.ts +93 -0
- package/src/photon/balancing/format/raise/response/index.ts +49 -0
- package/src/photon/balancing/format/reader/index.ts +362 -0
- package/src/photon/balancing/format/regions/index.ts +2 -0
- package/src/photon/balancing/format/regions/request/index.ts +49 -0
- package/src/photon/balancing/format/regions/response/index.ts +62 -0
- package/src/photon/balancing/format/rpc/index.ts +2 -0
- package/src/photon/balancing/format/rpc/request/index.ts +56 -0
- package/src/photon/balancing/format/rpc/response/index.ts +62 -0
- package/src/photon/balancing/format/settings/index.ts +2 -0
- package/src/photon/balancing/format/settings/request/index.ts +52 -0
- package/src/photon/balancing/format/settings/response/index.ts +49 -0
- package/src/photon/balancing/format/shared/credentials/index.ts +84 -0
- package/src/photon/balancing/format/shared/entry/index.ts +43 -0
- package/src/photon/balancing/format/shared/grant/index.ts +96 -0
- package/src/photon/balancing/format/shared/index.ts +6 -0
- package/src/photon/balancing/format/shared/lobby/index.ts +36 -0
- package/src/photon/balancing/format/shared/options/index.ts +68 -0
- package/src/photon/balancing/format/shared/stats/index.ts +55 -0
- package/src/photon/balancing/format/writer/index.ts +187 -0
- package/src/photon/balancing/index.ts +239 -0
- package/src/photon/balancing/packet/adapter/index.ts +39 -0
- package/src/photon/balancing/packet/authenticate/index.ts +2 -0
- package/src/photon/balancing/packet/authenticate/request/index.ts +105 -0
- package/src/photon/balancing/packet/authenticate/response/index.ts +49 -0
- package/src/photon/balancing/packet/event/auth/index.ts +30 -0
- package/src/photon/balancing/packet/event/azure/index.ts +54 -0
- package/src/photon/balancing/packet/event/custom/index.ts +50 -0
- package/src/photon/balancing/packet/event/disconnect/index.ts +30 -0
- package/src/photon/balancing/packet/event/error/index.ts +29 -0
- package/src/photon/balancing/packet/event/index.ts +16 -0
- package/src/photon/balancing/packet/event/join/index.ts +54 -0
- package/src/photon/balancing/packet/event/leave/index.ts +63 -0
- package/src/photon/balancing/packet/event/list/index.ts +30 -0
- package/src/photon/balancing/packet/event/match/index.ts +37 -0
- package/src/photon/balancing/packet/event/offline/index.ts +29 -0
- package/src/photon/balancing/packet/event/properties/index.ts +58 -0
- package/src/photon/balancing/packet/event/purged/index.ts +21 -0
- package/src/photon/balancing/packet/event/queue/index.ts +29 -0
- package/src/photon/balancing/packet/event/slice/index.ts +40 -0
- package/src/photon/balancing/packet/event/stats/app/index.ts +56 -0
- package/src/photon/balancing/packet/event/stats/index.ts +2 -0
- package/src/photon/balancing/packet/event/stats/lobby/index.ts +30 -0
- package/src/photon/balancing/packet/event/update/index.ts +30 -0
- package/src/photon/balancing/packet/friends/index.ts +2 -0
- package/src/photon/balancing/packet/friends/request/index.ts +40 -0
- package/src/photon/balancing/packet/friends/response/index.ts +60 -0
- package/src/photon/balancing/packet/game/create/index.ts +2 -0
- package/src/photon/balancing/packet/game/create/request/index.ts +160 -0
- package/src/photon/balancing/packet/game/create/response/index.ts +122 -0
- package/src/photon/balancing/packet/game/debug/index.ts +2 -0
- package/src/photon/balancing/packet/game/debug/request/index.ts +40 -0
- package/src/photon/balancing/packet/game/debug/response/index.ts +70 -0
- package/src/photon/balancing/packet/game/index.ts +8 -0
- package/src/photon/balancing/packet/game/join/index.ts +2 -0
- package/src/photon/balancing/packet/game/join/request/index.ts +218 -0
- package/src/photon/balancing/packet/game/join/response/index.ts +122 -0
- package/src/photon/balancing/packet/game/list/index.ts +2 -0
- package/src/photon/balancing/packet/game/list/request/index.ts +41 -0
- package/src/photon/balancing/packet/game/list/response/index.ts +49 -0
- package/src/photon/balancing/packet/game/random/index.ts +2 -0
- package/src/photon/balancing/packet/game/random/request/index.ts +172 -0
- package/src/photon/balancing/packet/game/random/response/index.ts +95 -0
- package/src/photon/balancing/packet/groups/index.ts +2 -0
- package/src/photon/balancing/packet/groups/request/index.ts +40 -0
- package/src/photon/balancing/packet/groups/response/index.ts +35 -0
- package/src/photon/balancing/packet/index.ts +69 -0
- package/src/photon/balancing/packet/leave/index.ts +2 -0
- package/src/photon/balancing/packet/leave/request/index.ts +40 -0
- package/src/photon/balancing/packet/leave/response/index.ts +35 -0
- package/src/photon/balancing/packet/lobby/index.ts +3 -0
- package/src/photon/balancing/packet/lobby/join/index.ts +2 -0
- package/src/photon/balancing/packet/lobby/join/request/index.ts +55 -0
- package/src/photon/balancing/packet/lobby/join/response/index.ts +35 -0
- package/src/photon/balancing/packet/lobby/leave/index.ts +2 -0
- package/src/photon/balancing/packet/lobby/leave/request/index.ts +21 -0
- package/src/photon/balancing/packet/lobby/leave/response/index.ts +43 -0
- package/src/photon/balancing/packet/lobby/stats/index.ts +2 -0
- package/src/photon/balancing/packet/lobby/stats/request/index.ts +43 -0
- package/src/photon/balancing/packet/lobby/stats/response/index.ts +49 -0
- package/src/photon/balancing/packet/once/index.ts +2 -0
- package/src/photon/balancing/packet/once/request/index.ts +70 -0
- package/src/photon/balancing/packet/once/response/index.ts +49 -0
- package/src/photon/balancing/packet/ping/index.ts +2 -0
- package/src/photon/balancing/packet/ping/request/index.ts +21 -0
- package/src/photon/balancing/packet/ping/response/index.ts +35 -0
- package/src/photon/balancing/packet/properties/get/index.ts +2 -0
- package/src/photon/balancing/packet/properties/get/request/index.ts +69 -0
- package/src/photon/balancing/packet/properties/get/response/index.ts +66 -0
- package/src/photon/balancing/packet/properties/index.ts +2 -0
- package/src/photon/balancing/packet/properties/set/index.ts +2 -0
- package/src/photon/balancing/packet/properties/set/request/index.ts +122 -0
- package/src/photon/balancing/packet/properties/set/response/index.ts +35 -0
- package/src/photon/balancing/packet/raise/index.ts +2 -0
- package/src/photon/balancing/packet/raise/request/index.ts +219 -0
- package/src/photon/balancing/packet/raise/response/index.ts +35 -0
- package/src/photon/balancing/packet/regions/index.ts +2 -0
- package/src/photon/balancing/packet/regions/request/index.ts +29 -0
- package/src/photon/balancing/packet/regions/response/index.ts +60 -0
- package/src/photon/balancing/packet/reply/index.ts +59 -0
- package/src/photon/balancing/packet/rpc/index.ts +2 -0
- package/src/photon/balancing/packet/rpc/request/index.ts +54 -0
- package/src/photon/balancing/packet/rpc/response/index.ts +88 -0
- package/src/photon/balancing/packet/settings/index.ts +2 -0
- package/src/photon/balancing/packet/settings/request/index.ts +29 -0
- package/src/photon/balancing/packet/settings/response/index.ts +35 -0
- package/src/photon/balancing/packet/unknown/index.ts +71 -0
- package/src/photon/balancing/pun/code/index.ts +376 -0
- package/src/photon/balancing/pun/destroy/index.ts +2 -0
- package/src/photon/balancing/pun/destroy/object/index.ts +48 -0
- package/src/photon/balancing/pun/destroy/player/index.ts +53 -0
- package/src/photon/balancing/pun/events/index.ts +283 -0
- package/src/photon/balancing/pun/filter/index.ts +45 -0
- package/src/photon/balancing/pun/index.ts +34 -0
- package/src/photon/balancing/pun/instantiation/index.ts +213 -0
- package/src/photon/balancing/pun/keys/index.ts +78 -0
- package/src/photon/balancing/pun/master/index.ts +48 -0
- package/src/photon/balancing/pun/ownership/index.ts +4 -0
- package/src/photon/balancing/pun/ownership/request/index.ts +55 -0
- package/src/photon/balancing/pun/ownership/transfer/index.ts +55 -0
- package/src/photon/balancing/pun/ownership/update/index.ts +57 -0
- package/src/photon/balancing/pun/rpc/index.ts +180 -0
- package/src/photon/balancing/pun/serialize/batch/index.ts +143 -0
- package/src/photon/balancing/pun/serialize/index.ts +2 -0
- package/src/photon/balancing/pun/serialize/view/index.ts +96 -0
- package/src/photon/balancing/pun/view/index.ts +41 -0
- package/src/photon/balancing/role/index.ts +24 -0
- package/src/photon/balancing/travel/index.ts +103 -0
- package/src/photon/binary/adapter/index.ts +619 -0
- package/src/photon/binary/custom/index.ts +148 -0
- package/src/photon/binary/dictionary/index.ts +110 -0
- package/src/photon/binary/disconnect/index.ts +51 -0
- package/src/photon/binary/event/index.ts +48 -0
- package/src/photon/binary/factory/index.ts +23 -0
- package/src/photon/binary/hashtable/index.ts +83 -0
- package/src/photon/binary/index.ts +25 -0
- package/src/photon/binary/kind/index.ts +104 -0
- package/src/photon/binary/parameters/index.ts +119 -0
- package/src/photon/binary/protocol/index.ts +122 -0
- package/src/photon/binary/request/index.ts +38 -0
- package/src/photon/binary/response/index.ts +92 -0
- package/src/photon/binary/shape/index.ts +260 -0
- package/src/photon/binary/v16/index.ts +834 -0
- package/src/photon/binary/v18/index.ts +1428 -0
- package/src/photon/binary/value/index.ts +414 -0
- package/src/photon/client/bot/index.ts +662 -0
- package/src/photon/client/connection/index.ts +420 -0
- package/src/photon/client/endpoint/index.ts +87 -0
- package/src/photon/client/failure/index.ts +37 -0
- package/src/photon/client/index.ts +5 -0
- package/src/photon/client/options/index.ts +78 -0
- package/src/photon/cluster/back/index.ts +186 -0
- package/src/photon/cluster/carriage/index.ts +334 -0
- package/src/photon/cluster/directory/index.ts +103 -0
- package/src/photon/cluster/dresser/index.ts +83 -0
- package/src/photon/cluster/feed/index.ts +267 -0
- package/src/photon/cluster/front/index.ts +205 -0
- package/src/photon/cluster/grid/index.ts +429 -0
- package/src/photon/cluster/hub/index.ts +434 -0
- package/src/photon/cluster/index.ts +18 -0
- package/src/photon/cluster/mover/index.ts +173 -0
- package/src/photon/cluster/parcel/index.ts +158 -0
- package/src/photon/cluster/pooled/index.ts +66 -0
- package/src/photon/cluster/press/index.ts +96 -0
- package/src/photon/cluster/route/game/index.ts +95 -0
- package/src/photon/cluster/route/index.ts +3 -0
- package/src/photon/cluster/route/master/index.ts +235 -0
- package/src/photon/cluster/route/name/index.ts +176 -0
- package/src/photon/cluster/seat/game/index.ts +113 -0
- package/src/photon/cluster/seat/index.ts +2 -0
- package/src/photon/cluster/seat/master/index.ts +97 -0
- package/src/photon/cluster/seed/index.ts +190 -0
- package/src/photon/cluster/sessions/index.ts +136 -0
- package/src/photon/cluster/spread/index.ts +236 -0
- package/src/photon/cluster/value/index.ts +46 -0
- package/src/photon/crypto/code/index.ts +149 -0
- package/src/photon/crypto/connection/index.ts +127 -0
- package/src/photon/crypto/data/index.ts +214 -0
- package/src/photon/crypto/datagram/index.ts +119 -0
- package/src/photon/crypto/error/index.ts +29 -0
- package/src/photon/crypto/exchange/index.ts +187 -0
- package/src/photon/crypto/index.ts +31 -0
- package/src/photon/crypto/init/binary/index.ts +249 -0
- package/src/photon/crypto/init/http/index.ts +222 -0
- package/src/photon/crypto/init/index.ts +6 -0
- package/src/photon/crypto/init/query/index.ts +85 -0
- package/src/photon/crypto/init/socket/index.ts +82 -0
- package/src/photon/crypto/method/index.ts +20 -0
- package/src/photon/crypto/mode/index.ts +35 -0
- package/src/photon/crypto/once/gate/index.ts +60 -0
- package/src/photon/crypto/once/index.ts +4 -0
- package/src/photon/crypto/once/reply/index.ts +96 -0
- package/src/photon/crypto/once/request/index.ts +14 -0
- package/src/photon/crypto/payload/index.ts +189 -0
- package/src/photon/crypto/protocol/index.ts +30 -0
- package/src/photon/crypto/refusal/index.ts +118 -0
- package/src/photon/crypto/sequence/index.ts +97 -0
- package/src/photon/crypto/token/authority/index.ts +158 -0
- package/src/photon/crypto/token/codec/index.ts +18 -0
- package/src/photon/crypto/token/index.ts +5 -0
- package/src/photon/crypto/token/record/index.ts +116 -0
- package/src/photon/crypto/token/sealed/index.ts +285 -0
- package/src/photon/crypto/token/verdict/index.ts +43 -0
- package/src/photon/enet/client/index.ts +204 -0
- package/src/photon/enet/closure/index.ts +90 -0
- package/src/photon/enet/command/index.ts +301 -0
- package/src/photon/enet/datagram/index.ts +289 -0
- package/src/photon/enet/flight/index.ts +93 -0
- package/src/photon/enet/gateway/index.ts +311 -0
- package/src/photon/enet/handler/index.ts +65 -0
- package/src/photon/enet/index.ts +21 -0
- package/src/photon/enet/lane/index.ts +403 -0
- package/src/photon/enet/link/index.ts +200 -0
- package/src/photon/enet/options/index.ts +283 -0
- package/src/photon/enet/peer/index.ts +1527 -0
- package/src/photon/enet/server/index.ts +107 -0
- package/src/photon/enet/transport/index.ts +83 -0
- package/src/photon/enet/window/index.ts +48 -0
- package/src/photon/envelope/index.ts +83 -0
- package/src/photon/family/index.ts +41 -0
- package/src/photon/frame/index.ts +88 -0
- package/src/photon/game/actor/index.ts +117 -0
- package/src/photon/game/authenticator/index.ts +139 -0
- package/src/photon/game/bag/index.ts +169 -0
- package/src/photon/game/cache/index.ts +456 -0
- package/src/photon/game/clock/index.ts +137 -0
- package/src/photon/game/compare/index.ts +162 -0
- package/src/photon/game/entry/index.ts +334 -0
- package/src/photon/game/fault/index.ts +77 -0
- package/src/photon/game/gate/index.ts +177 -0
- package/src/photon/game/groups/index.ts +115 -0
- package/src/photon/game/guard/index.ts +54 -0
- package/src/photon/game/handler/index.ts +458 -0
- package/src/photon/game/hooked/index.ts +873 -0
- package/src/photon/game/index.ts +41 -0
- package/src/photon/game/peer/index.ts +186 -0
- package/src/photon/game/report/index.ts +120 -0
- package/src/photon/game/room/index.ts +2271 -0
- package/src/photon/game/rooms/index.ts +149 -0
- package/src/photon/game/server/index.ts +503 -0
- package/src/photon/game/settings/index.ts +341 -0
- package/src/photon/game/shared/index.ts +54 -0
- package/src/photon/game/snapshot/index.ts +124 -0
- package/src/photon/game/stage/index.ts +74 -0
- package/src/photon/game/touch/index.ts +43 -0
- package/src/photon/game/wellknown/index.ts +353 -0
- package/src/photon/hooks/index.ts +9 -0
- package/src/photon/hooks/reason/index.ts +129 -0
- package/src/photon/hooks/reply/index.ts +239 -0
- package/src/photon/hooks/request/index.ts +383 -0
- package/src/photon/hooks/sender/index.ts +268 -0
- package/src/photon/hooks/settings/index.ts +383 -0
- package/src/photon/hooks/state/index.ts +545 -0
- package/src/photon/index.ts +31 -0
- package/src/photon/master/application/index.ts +446 -0
- package/src/photon/master/balancer/index.ts +170 -0
- package/src/photon/master/context/index.ts +127 -0
- package/src/photon/master/equality/index.ts +104 -0
- package/src/photon/master/fault/index.ts +86 -0
- package/src/photon/master/game/index.ts +847 -0
- package/src/photon/master/gate/index.ts +243 -0
- package/src/photon/master/handler/index.ts +1103 -0
- package/src/photon/master/index.ts +20 -0
- package/src/photon/master/list/channel/index.ts +417 -0
- package/src/photon/master/list/games/index.ts +419 -0
- package/src/photon/master/list/index.ts +6 -0
- package/src/photon/master/list/limited/index.ts +103 -0
- package/src/photon/master/list/plain/index.ts +47 -0
- package/src/photon/master/list/silent/index.ts +45 -0
- package/src/photon/master/list/sql/index.ts +280 -0
- package/src/photon/master/lobbies/index.ts +85 -0
- package/src/photon/master/lobby/index.ts +572 -0
- package/src/photon/master/peer/index.ts +168 -0
- package/src/photon/master/players/index.ts +177 -0
- package/src/photon/master/redirect/index.ts +90 -0
- package/src/photon/master/rpc/index.ts +2 -0
- package/src/photon/master/server/index.ts +212 -0
- package/src/photon/master/settings/index.ts +515 -0
- package/src/photon/master/sql/error/index.ts +92 -0
- package/src/photon/master/sql/host/index.ts +153 -0
- package/src/photon/master/sql/index.ts +9 -0
- package/src/photon/master/sql/relay/index.ts +141 -0
- package/src/photon/master/sql/remote/index.ts +257 -0
- package/src/photon/master/sql/store/index.ts +37 -0
- package/src/photon/master/sql/table/index.ts +219 -0
- package/src/photon/master/sql/value/index.ts +93 -0
- package/src/photon/master/sql/watch/index.ts +80 -0
- package/src/photon/master/sql/wire/index.ts +98 -0
- package/src/photon/master/stats/app/index.ts +122 -0
- package/src/photon/master/stats/index.ts +2 -0
- package/src/photon/master/stats/lobby/index.ts +180 -0
- package/src/photon/master/wellknown/index.ts +220 -0
- package/src/photon/message/binary/index.ts +289 -0
- package/src/photon/message/client/index.ts +110 -0
- package/src/photon/message/dialect/index.ts +61 -0
- package/src/photon/message/format/index.ts +21 -0
- package/src/photon/message/handler/index.ts +176 -0
- package/src/photon/message/index.ts +23 -0
- package/src/photon/message/init/classic/index.ts +204 -0
- package/src/photon/message/init/form/index.ts +29 -0
- package/src/photon/message/init/index.ts +6 -0
- package/src/photon/message/init/request/index.ts +388 -0
- package/src/photon/message/internal/index.ts +203 -0
- package/src/photon/message/json/format/index.ts +129 -0
- package/src/photon/message/json/index.ts +3 -0
- package/src/photon/message/json/keys/index.ts +44 -0
- package/src/photon/message/json/values/index.ts +323 -0
- package/src/photon/message/once/index.ts +69 -0
- package/src/photon/message/peer/index.ts +276 -0
- package/src/photon/message/pipeline/index.ts +350 -0
- package/src/photon/message/server/index.ts +208 -0
- package/src/photon/message/type/index.ts +59 -0
- package/src/photon/message/watch/index.ts +30 -0
- package/src/photon/message/wire/index.ts +215 -0
- package/src/photon/name/config/index.ts +133 -0
- package/src/photon/name/handler/index.ts +816 -0
- package/src/photon/name/index.ts +12 -0
- package/src/photon/name/node/index.ts +181 -0
- package/src/photon/name/peer/index.ts +23 -0
- package/src/photon/name/regions/index.ts +110 -0
- package/src/photon/name/server/index.ts +207 -0
- package/src/photon/registry/index.ts +244 -0
- package/src/photon/rpc/fault/index.ts +60 -0
- package/src/photon/rpc/http/index.ts +508 -0
- package/src/photon/rpc/index.ts +10 -0
- package/src/photon/rpc/meter/index.ts +47 -0
- package/src/photon/rpc/relay/index.ts +112 -0
- package/src/photon/rpc/service/index.ts +67 -0
- package/src/photon/seal/index.ts +17 -0
- package/src/photon/server/config/index.ts +241 -0
- package/src/photon/server/gatekeeper/index.ts +99 -0
- package/src/photon/server/host/index.ts +581 -0
- package/src/photon/server/index.ts +5 -0
- package/src/photon/server/listeners/index.ts +250 -0
- package/src/photon/server/ports/index.ts +156 -0
- package/src/photon/tcp/client/index.ts +64 -0
- package/src/photon/tcp/clock/index.ts +12 -0
- package/src/photon/tcp/codec/index.ts +174 -0
- package/src/photon/tcp/framing/index.ts +131 -0
- package/src/photon/tcp/index.ts +8 -0
- package/src/photon/tcp/ping/index.ts +43 -0
- package/src/photon/tcp/pong/index.ts +53 -0
- package/src/photon/tcp/server/index.ts +81 -0
- package/src/photon/timers/index.ts +68 -0
- package/src/photon/websocket/binary/index.ts +71 -0
- package/src/photon/websocket/bridge/index.ts +301 -0
- package/src/photon/websocket/framing/index.ts +45 -0
- package/src/photon/websocket/index.ts +14 -0
- package/src/photon/websocket/json/index.ts +49 -0
- package/src/photon/websocket/message/index.ts +176 -0
- package/src/photon/websocket/negotiation/index.ts +99 -0
- package/src/photon/websocket/path/index.ts +52 -0
- package/src/photon/websocket/plain/index.ts +25 -0
- package/src/photon/websocket/query/index.ts +99 -0
- package/src/photon/websocket/reassembly/index.ts +75 -0
- package/src/photon/websocket/subprotocol/index.ts +24 -0
- package/src/photon/websocket/text/index.ts +80 -0
- package/src/protocol/index.ts +61 -0
- package/src/scale/batch/index.ts +210 -0
- package/src/scale/courier/index.ts +726 -0
- package/src/scale/datagram/index.ts +337 -0
- package/src/scale/fanout/index.ts +654 -0
- package/src/scale/handoff/index.ts +271 -0
- package/src/scale/hosted/index.ts +68 -0
- package/src/scale/index.ts +41 -0
- package/src/scale/layout/index.ts +29 -0
- package/src/scale/mesh/index.ts +211 -0
- package/src/scale/outlet/index.ts +121 -0
- package/src/scale/pending/index.ts +165 -0
- package/src/scale/placement/index.ts +89 -0
- package/src/scale/portable/index.ts +42 -0
- package/src/scale/relay/index.ts +136 -0
- package/src/scale/sink/index.ts +51 -0
- package/src/scale/switchboard/index.ts +91 -0
- package/src/scale/transport/index.ts +112 -0
- package/src/scale/tunnel/index.ts +743 -0
- package/src/smartfox/index.ts +2 -0
- package/src/smartfox/pro/bans/index.ts +3 -0
- package/src/smartfox/pro/bans/list/index.ts +101 -0
- package/src/smartfox/pro/bans/memory/index.ts +57 -0
- package/src/smartfox/pro/bans/store/index.ts +43 -0
- package/src/smartfox/pro/bluebox/gateway/index.ts +310 -0
- package/src/smartfox/pro/bluebox/index.ts +4 -0
- package/src/smartfox/pro/bluebox/session/index.ts +63 -0
- package/src/smartfox/pro/bluebox/transport/index.ts +104 -0
- package/src/smartfox/pro/buddies/index.ts +4 -0
- package/src/smartfox/pro/buddies/memory/index.ts +38 -0
- package/src/smartfox/pro/buddies/roster/index.ts +411 -0
- package/src/smartfox/pro/buddies/store/index.ts +37 -0
- package/src/smartfox/pro/buddy/index.ts +65 -0
- package/src/smartfox/pro/catalogue/index.ts +141 -0
- package/src/smartfox/pro/claims/index.ts +110 -0
- package/src/smartfox/pro/codec/index.ts +87 -0
- package/src/smartfox/pro/counters/index.ts +3 -0
- package/src/smartfox/pro/counters/memory/index.ts +90 -0
- package/src/smartfox/pro/counters/offender/index.ts +47 -0
- package/src/smartfox/pro/counters/store/index.ts +17 -0
- package/src/smartfox/pro/entity/index.ts +111 -0
- package/src/smartfox/pro/escalation/index.ts +194 -0
- package/src/smartfox/pro/filter/index.ts +226 -0
- package/src/smartfox/pro/flood/index.ts +190 -0
- package/src/smartfox/pro/format/buddy/add/index.ts +2 -0
- package/src/smartfox/pro/format/buddy/add/notice/index.ts +44 -0
- package/src/smartfox/pro/format/buddy/add/request/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/block/index.ts +44 -0
- package/src/smartfox/pro/format/buddy/clear/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/index.ts +13 -0
- package/src/smartfox/pro/format/buddy/list/index.ts +59 -0
- package/src/smartfox/pro/format/buddy/load/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/permission/index.ts +2 -0
- package/src/smartfox/pro/format/buddy/permission/notice/index.ts +43 -0
- package/src/smartfox/pro/format/buddy/permission/request/index.ts +48 -0
- package/src/smartfox/pro/format/buddy/remove/index.ts +2 -0
- package/src/smartfox/pro/format/buddy/remove/notice/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/remove/request/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/room/index.ts +2 -0
- package/src/smartfox/pro/format/buddy/room/reply/index.ts +50 -0
- package/src/smartfox/pro/format/buddy/room/request/index.ts +37 -0
- package/src/smartfox/pro/format/buddy/update/index.ts +54 -0
- package/src/smartfox/pro/format/buddy/variables/index.ts +48 -0
- package/src/smartfox/pro/format/chat/admin/index.ts +48 -0
- package/src/smartfox/pro/format/chat/index.ts +13 -0
- package/src/smartfox/pro/format/chat/moderator/index.ts +2 -0
- package/src/smartfox/pro/format/chat/moderator/message/index.ts +48 -0
- package/src/smartfox/pro/format/chat/moderator/request/index.ts +52 -0
- package/src/smartfox/pro/format/chat/private/index.ts +2 -0
- package/src/smartfox/pro/format/chat/private/message/index.ts +48 -0
- package/src/smartfox/pro/format/chat/private/request/index.ts +49 -0
- package/src/smartfox/pro/format/chat/public/index.ts +2 -0
- package/src/smartfox/pro/format/chat/public/message/index.ts +48 -0
- package/src/smartfox/pro/format/chat/public/request/index.ts +40 -0
- package/src/smartfox/pro/format/create/added/index.ts +76 -0
- package/src/smartfox/pro/format/create/deleted/index.ts +37 -0
- package/src/smartfox/pro/format/create/index.ts +4 -0
- package/src/smartfox/pro/format/create/refused/index.ts +37 -0
- package/src/smartfox/pro/format/create/request/index.ts +95 -0
- package/src/smartfox/pro/format/data/group/index.ts +62 -0
- package/src/smartfox/pro/format/data/index.ts +3 -0
- package/src/smartfox/pro/format/data/message/index.ts +54 -0
- package/src/smartfox/pro/format/data/request/index.ts +46 -0
- package/src/smartfox/pro/format/entry/buddy/index.ts +62 -0
- package/src/smartfox/pro/format/entry/index.ts +5 -0
- package/src/smartfox/pro/format/entry/object/index.ts +171 -0
- package/src/smartfox/pro/format/entry/room/index.ts +70 -0
- package/src/smartfox/pro/format/entry/user/index.ts +60 -0
- package/src/smartfox/pro/format/entry/variables/index.ts +148 -0
- package/src/smartfox/pro/format/extension/index.ts +3 -0
- package/src/smartfox/pro/format/extension/json/index.ts +99 -0
- package/src/smartfox/pro/format/extension/object/index.ts +95 -0
- package/src/smartfox/pro/format/extension/raw/index.ts +139 -0
- package/src/smartfox/pro/format/index.ts +86 -0
- package/src/smartfox/pro/format/join/accepted/index.ts +72 -0
- package/src/smartfox/pro/format/join/index.ts +3 -0
- package/src/smartfox/pro/format/join/refused/index.ts +37 -0
- package/src/smartfox/pro/format/join/request/index.ts +54 -0
- package/src/smartfox/pro/format/key/index.ts +2 -0
- package/src/smartfox/pro/format/key/reply/index.ts +37 -0
- package/src/smartfox/pro/format/key/request/index.ts +37 -0
- package/src/smartfox/pro/format/leave/index.ts +2 -0
- package/src/smartfox/pro/format/leave/notice/index.ts +41 -0
- package/src/smartfox/pro/format/leave/request/index.ts +41 -0
- package/src/smartfox/pro/format/login/accepted/index.ts +49 -0
- package/src/smartfox/pro/format/login/index.ts +3 -0
- package/src/smartfox/pro/format/login/refused/index.ts +37 -0
- package/src/smartfox/pro/format/login/request/index.ts +53 -0
- package/src/smartfox/pro/format/logout/index.ts +2 -0
- package/src/smartfox/pro/format/logout/notice/index.ts +37 -0
- package/src/smartfox/pro/format/logout/request/index.ts +37 -0
- package/src/smartfox/pro/format/ping/index.ts +2 -0
- package/src/smartfox/pro/format/ping/reply/index.ts +37 -0
- package/src/smartfox/pro/format/ping/request/index.ts +37 -0
- package/src/smartfox/pro/format/presence/count/index.ts +44 -0
- package/src/smartfox/pro/format/presence/entered/index.ts +47 -0
- package/src/smartfox/pro/format/presence/index.ts +3 -0
- package/src/smartfox/pro/format/presence/left/index.ts +44 -0
- package/src/smartfox/pro/format/rooms/auto/index.ts +37 -0
- package/src/smartfox/pro/format/rooms/index.ts +3 -0
- package/src/smartfox/pro/format/rooms/list/index.ts +54 -0
- package/src/smartfox/pro/format/rooms/request/index.ts +37 -0
- package/src/smartfox/pro/format/seat/index.ts +8 -0
- package/src/smartfox/pro/format/seat/player/index.ts +2 -0
- package/src/smartfox/pro/format/seat/player/notice/index.ts +49 -0
- package/src/smartfox/pro/format/seat/player/request/index.ts +37 -0
- package/src/smartfox/pro/format/seat/spectator/index.ts +2 -0
- package/src/smartfox/pro/format/seat/spectator/notice/index.ts +49 -0
- package/src/smartfox/pro/format/seat/spectator/request/index.ts +38 -0
- package/src/smartfox/pro/format/system/index.ts +19 -0
- package/src/smartfox/pro/format/variables/index.ts +8 -0
- package/src/smartfox/pro/format/variables/room/index.ts +2 -0
- package/src/smartfox/pro/format/variables/room/request/index.ts +50 -0
- package/src/smartfox/pro/format/variables/room/update/index.ts +52 -0
- package/src/smartfox/pro/format/variables/user/index.ts +2 -0
- package/src/smartfox/pro/format/variables/user/request/index.ts +47 -0
- package/src/smartfox/pro/format/variables/user/update/index.ts +52 -0
- package/src/smartfox/pro/format/version/accepted/index.ts +37 -0
- package/src/smartfox/pro/format/version/index.ts +3 -0
- package/src/smartfox/pro/format/version/refused/index.ts +37 -0
- package/src/smartfox/pro/format/version/request/index.ts +37 -0
- package/src/smartfox/pro/handler/buddy/index.ts +138 -0
- package/src/smartfox/pro/handler/chat/index.ts +221 -0
- package/src/smartfox/pro/handler/index.ts +7 -0
- package/src/smartfox/pro/handler/login/index.ts +175 -0
- package/src/smartfox/pro/handler/room/index.ts +121 -0
- package/src/smartfox/pro/handler/seat/index.ts +75 -0
- package/src/smartfox/pro/handler/shared/index.ts +29 -0
- package/src/smartfox/pro/handler/variable/index.ts +77 -0
- package/src/smartfox/pro/index.ts +60 -0
- package/src/smartfox/pro/login/attempt/index.ts +83 -0
- package/src/smartfox/pro/login/authenticator/index.ts +9 -0
- package/src/smartfox/pro/login/index.ts +3 -0
- package/src/smartfox/pro/login/verdict/index.ts +48 -0
- package/src/smartfox/pro/messages/index.ts +136 -0
- package/src/smartfox/pro/object/index.ts +12 -0
- package/src/smartfox/pro/options/index.ts +189 -0
- package/src/smartfox/pro/packet/buddy/add/index.ts +2 -0
- package/src/smartfox/pro/packet/buddy/add/notice/index.ts +27 -0
- package/src/smartfox/pro/packet/buddy/add/request/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/block/index.ts +33 -0
- package/src/smartfox/pro/packet/buddy/clear/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/index.ts +10 -0
- package/src/smartfox/pro/packet/buddy/list/index.ts +41 -0
- package/src/smartfox/pro/packet/buddy/load/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/permission/index.ts +2 -0
- package/src/smartfox/pro/packet/buddy/permission/notice/index.ts +33 -0
- package/src/smartfox/pro/packet/buddy/permission/request/index.ts +33 -0
- package/src/smartfox/pro/packet/buddy/remove/index.ts +2 -0
- package/src/smartfox/pro/packet/buddy/remove/notice/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/remove/request/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/room/index.ts +2 -0
- package/src/smartfox/pro/packet/buddy/room/reply/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/room/request/index.ts +25 -0
- package/src/smartfox/pro/packet/buddy/update/index.ts +35 -0
- package/src/smartfox/pro/packet/buddy/variables/index.ts +27 -0
- package/src/smartfox/pro/packet/chat/admin/index.ts +41 -0
- package/src/smartfox/pro/packet/chat/index.ts +5 -0
- package/src/smartfox/pro/packet/chat/moderator/index.ts +3 -0
- package/src/smartfox/pro/packet/chat/moderator/message/index.ts +41 -0
- package/src/smartfox/pro/packet/chat/moderator/request/index.ts +64 -0
- package/src/smartfox/pro/packet/chat/private/index.ts +2 -0
- package/src/smartfox/pro/packet/chat/private/message/index.ts +41 -0
- package/src/smartfox/pro/packet/chat/private/request/index.ts +45 -0
- package/src/smartfox/pro/packet/chat/public/index.ts +2 -0
- package/src/smartfox/pro/packet/chat/public/message/index.ts +41 -0
- package/src/smartfox/pro/packet/chat/public/request/index.ts +33 -0
- package/src/smartfox/pro/packet/create/added/index.ts +27 -0
- package/src/smartfox/pro/packet/create/deleted/index.ts +25 -0
- package/src/smartfox/pro/packet/create/index.ts +5 -0
- package/src/smartfox/pro/packet/create/refused/index.ts +25 -0
- package/src/smartfox/pro/packet/create/request/index.ts +105 -0
- package/src/smartfox/pro/packet/data/group/index.ts +51 -0
- package/src/smartfox/pro/packet/data/index.ts +3 -0
- package/src/smartfox/pro/packet/data/message/index.ts +43 -0
- package/src/smartfox/pro/packet/data/request/index.ts +35 -0
- package/src/smartfox/pro/packet/extension/index.ts +3 -0
- package/src/smartfox/pro/packet/extension/json/index.ts +2 -0
- package/src/smartfox/pro/packet/extension/json/reply/index.ts +33 -0
- package/src/smartfox/pro/packet/extension/json/request/index.ts +66 -0
- package/src/smartfox/pro/packet/extension/object/index.ts +2 -0
- package/src/smartfox/pro/packet/extension/object/reply/index.ts +35 -0
- package/src/smartfox/pro/packet/extension/object/request/index.ts +68 -0
- package/src/smartfox/pro/packet/extension/raw/index.ts +2 -0
- package/src/smartfox/pro/packet/extension/raw/reply/index.ts +25 -0
- package/src/smartfox/pro/packet/extension/raw/request/index.ts +66 -0
- package/src/smartfox/pro/packet/frame/index.ts +2 -0
- package/src/smartfox/pro/packet/frame/policy/file/index.ts +25 -0
- package/src/smartfox/pro/packet/frame/policy/index.ts +2 -0
- package/src/smartfox/pro/packet/frame/policy/request/index.ts +25 -0
- package/src/smartfox/pro/packet/frame/unknown/index.ts +25 -0
- package/src/smartfox/pro/packet/index.ts +72 -0
- package/src/smartfox/pro/packet/join/accepted/index.ts +74 -0
- package/src/smartfox/pro/packet/join/index.ts +3 -0
- package/src/smartfox/pro/packet/join/refused/index.ts +25 -0
- package/src/smartfox/pro/packet/join/request/index.ts +79 -0
- package/src/smartfox/pro/packet/key/index.ts +2 -0
- package/src/smartfox/pro/packet/key/reply/index.ts +25 -0
- package/src/smartfox/pro/packet/key/request/index.ts +25 -0
- package/src/smartfox/pro/packet/leave/index.ts +2 -0
- package/src/smartfox/pro/packet/leave/notice/index.ts +25 -0
- package/src/smartfox/pro/packet/leave/request/index.ts +25 -0
- package/src/smartfox/pro/packet/login/accepted/index.ts +45 -0
- package/src/smartfox/pro/packet/login/index.ts +3 -0
- package/src/smartfox/pro/packet/login/refused/index.ts +25 -0
- package/src/smartfox/pro/packet/login/request/index.ts +41 -0
- package/src/smartfox/pro/packet/logout/index.ts +2 -0
- package/src/smartfox/pro/packet/logout/notice/index.ts +25 -0
- package/src/smartfox/pro/packet/logout/request/index.ts +25 -0
- package/src/smartfox/pro/packet/ping/index.ts +2 -0
- package/src/smartfox/pro/packet/ping/reply/index.ts +25 -0
- package/src/smartfox/pro/packet/ping/request/index.ts +25 -0
- package/src/smartfox/pro/packet/presence/count/index.ts +41 -0
- package/src/smartfox/pro/packet/presence/entered/index.ts +35 -0
- package/src/smartfox/pro/packet/presence/index.ts +3 -0
- package/src/smartfox/pro/packet/presence/left/index.ts +33 -0
- package/src/smartfox/pro/packet/rooms/auto/index.ts +25 -0
- package/src/smartfox/pro/packet/rooms/index.ts +3 -0
- package/src/smartfox/pro/packet/rooms/list/index.ts +27 -0
- package/src/smartfox/pro/packet/rooms/request/index.ts +25 -0
- package/src/smartfox/pro/packet/seat/index.ts +2 -0
- package/src/smartfox/pro/packet/seat/player/index.ts +2 -0
- package/src/smartfox/pro/packet/seat/player/notice/index.ts +45 -0
- package/src/smartfox/pro/packet/seat/player/request/index.ts +25 -0
- package/src/smartfox/pro/packet/seat/spectator/index.ts +2 -0
- package/src/smartfox/pro/packet/seat/spectator/notice/index.ts +45 -0
- package/src/smartfox/pro/packet/seat/spectator/request/index.ts +25 -0
- package/src/smartfox/pro/packet/variables/index.ts +2 -0
- package/src/smartfox/pro/packet/variables/room/index.ts +2 -0
- package/src/smartfox/pro/packet/variables/room/request/index.ts +51 -0
- package/src/smartfox/pro/packet/variables/room/update/index.ts +47 -0
- package/src/smartfox/pro/packet/variables/user/index.ts +2 -0
- package/src/smartfox/pro/packet/variables/user/request/index.ts +35 -0
- package/src/smartfox/pro/packet/variables/user/update/index.ts +47 -0
- package/src/smartfox/pro/packet/version/accepted/index.ts +25 -0
- package/src/smartfox/pro/packet/version/index.ts +3 -0
- package/src/smartfox/pro/packet/version/refused/index.ts +25 -0
- package/src/smartfox/pro/packet/version/request/index.ts +25 -0
- package/src/smartfox/pro/penalty/index.ts +65 -0
- package/src/smartfox/pro/protocol/index.ts +395 -0
- package/src/smartfox/pro/room/index.ts +155 -0
- package/src/smartfox/pro/route/index.ts +25 -0
- package/src/smartfox/pro/sequence/index.ts +35 -0
- package/src/smartfox/pro/user/index.ts +80 -0
- package/src/smartfox/pro/variable/index.ts +34 -0
- package/src/smartfox/pro/web/index.ts +155 -0
- package/src/smartfox/pro/xml/index.ts +2 -0
- package/src/smartfox/pro/xml/reader/index.ts +228 -0
- package/src/smartfox/pro/xml/templates/index.ts +169 -0
- package/src/smartfox/pro/xml/writer/index.ts +147 -0
- package/src/smartfox/pro/zone/index.ts +874 -0
- package/src/smartfox/pro/zones/index.ts +324 -0
- package/src/smartfox/x2/balancer/index.ts +193 -0
- package/src/smartfox/x2/ban/index.ts +4 -0
- package/src/smartfox/x2/ban/list/index.ts +136 -0
- package/src/smartfox/x2/ban/memory/index.ts +71 -0
- package/src/smartfox/x2/ban/record/index.ts +36 -0
- package/src/smartfox/x2/ban/store/index.ts +28 -0
- package/src/smartfox/x2/bluebox/gateway/index.ts +315 -0
- package/src/smartfox/x2/bluebox/index.ts +4 -0
- package/src/smartfox/x2/bluebox/session/index.ts +63 -0
- package/src/smartfox/x2/bluebox/transport/index.ts +125 -0
- package/src/smartfox/x2/buddies/index.ts +608 -0
- package/src/smartfox/x2/catalogue/index.ts +23 -0
- package/src/smartfox/x2/catalogue/requests/index.ts +91 -0
- package/src/smartfox/x2/catalogue/responses/index.ts +93 -0
- package/src/smartfox/x2/chat/index.ts +383 -0
- package/src/smartfox/x2/cipher/index.ts +88 -0
- package/src/smartfox/x2/codec/index.ts +201 -0
- package/src/smartfox/x2/config/index.ts +383 -0
- package/src/smartfox/x2/data/array/index.ts +467 -0
- package/src/smartfox/x2/data/entry/index.ts +35 -0
- package/src/smartfox/x2/data/index.ts +6 -0
- package/src/smartfox/x2/data/object/index.ts +597 -0
- package/src/smartfox/x2/data/serializer/index.ts +393 -0
- package/src/smartfox/x2/data/type/index.ts +94 -0
- package/src/smartfox/x2/entity/buddy/index.ts +114 -0
- package/src/smartfox/x2/entity/index.ts +38 -0
- package/src/smartfox/x2/entity/invitation/index.ts +90 -0
- package/src/smartfox/x2/entity/item/index.ts +74 -0
- package/src/smartfox/x2/entity/match/index.ts +269 -0
- package/src/smartfox/x2/entity/privilege/index.ts +26 -0
- package/src/smartfox/x2/entity/room/index.ts +334 -0
- package/src/smartfox/x2/entity/settings/index.ts +239 -0
- package/src/smartfox/x2/entity/user/index.ts +118 -0
- package/src/smartfox/x2/entity/variable/buddy/index.ts +114 -0
- package/src/smartfox/x2/entity/variable/index.ts +16 -0
- package/src/smartfox/x2/entity/variable/item/index.ts +114 -0
- package/src/smartfox/x2/entity/variable/room/index.ts +153 -0
- package/src/smartfox/x2/entity/variable/type/index.ts +166 -0
- package/src/smartfox/x2/entity/variable/user/index.ts +134 -0
- package/src/smartfox/x2/entity/vector/index.ts +127 -0
- package/src/smartfox/x2/flood/gate/index.ts +78 -0
- package/src/smartfox/x2/flood/index.ts +162 -0
- package/src/smartfox/x2/flood/shared/index.ts +113 -0
- package/src/smartfox/x2/format/buddy/add/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/add/request/index.ts +42 -0
- package/src/smartfox/x2/format/buddy/add/response/index.ts +55 -0
- package/src/smartfox/x2/format/buddy/block/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/block/request/index.ts +45 -0
- package/src/smartfox/x2/format/buddy/block/response/index.ts +60 -0
- package/src/smartfox/x2/format/buddy/index.ts +21 -0
- package/src/smartfox/x2/format/buddy/init/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/init/request/index.ts +38 -0
- package/src/smartfox/x2/format/buddy/init/response/index.ts +92 -0
- package/src/smartfox/x2/format/buddy/online/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/online/request/index.ts +42 -0
- package/src/smartfox/x2/format/buddy/online/response/index.ts +61 -0
- package/src/smartfox/x2/format/buddy/remove/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/remove/request/index.ts +42 -0
- package/src/smartfox/x2/format/buddy/remove/response/index.ts +51 -0
- package/src/smartfox/x2/format/buddy/variables/index.ts +2 -0
- package/src/smartfox/x2/format/buddy/variables/request/index.ts +46 -0
- package/src/smartfox/x2/format/buddy/variables/response/index.ts +58 -0
- package/src/smartfox/x2/format/cluster/connection/index.ts +1 -0
- package/src/smartfox/x2/format/cluster/connection/response/index.ts +52 -0
- package/src/smartfox/x2/format/cluster/error/index.ts +1 -0
- package/src/smartfox/x2/format/cluster/error/response/index.ts +38 -0
- package/src/smartfox/x2/format/cluster/index.ts +4 -0
- package/src/smartfox/x2/format/cluster/invite/index.ts +1 -0
- package/src/smartfox/x2/format/cluster/invite/request/index.ts +55 -0
- package/src/smartfox/x2/format/cluster/join/index.ts +1 -0
- package/src/smartfox/x2/format/cluster/join/request/index.ts +107 -0
- package/src/smartfox/x2/format/contract/index.ts +37 -0
- package/src/smartfox/x2/format/disconnect/index.ts +1 -0
- package/src/smartfox/x2/format/disconnect/request/index.ts +39 -0
- package/src/smartfox/x2/format/event/count/index.ts +49 -0
- package/src/smartfox/x2/format/event/disconnection/index.ts +48 -0
- package/src/smartfox/x2/format/event/enter/index.ts +53 -0
- package/src/smartfox/x2/format/event/exit/index.ts +45 -0
- package/src/smartfox/x2/format/event/index.ts +7 -0
- package/src/smartfox/x2/format/event/item/index.ts +51 -0
- package/src/smartfox/x2/format/event/lost/index.ts +2 -0
- package/src/smartfox/x2/format/event/lost/room/index.ts +42 -0
- package/src/smartfox/x2/format/event/lost/user/index.ts +42 -0
- package/src/smartfox/x2/format/event/reconnection/index.ts +39 -0
- package/src/smartfox/x2/format/extension/index.ts +2 -0
- package/src/smartfox/x2/format/extension/request/index.ts +49 -0
- package/src/smartfox/x2/format/extension/response/index.ts +47 -0
- package/src/smartfox/x2/format/find/index.ts +8 -0
- package/src/smartfox/x2/format/find/rooms/index.ts +2 -0
- package/src/smartfox/x2/format/find/rooms/request/index.ts +51 -0
- package/src/smartfox/x2/format/find/rooms/response/index.ts +74 -0
- package/src/smartfox/x2/format/find/users/index.ts +2 -0
- package/src/smartfox/x2/format/find/users/request/index.ts +54 -0
- package/src/smartfox/x2/format/find/users/response/index.ts +74 -0
- package/src/smartfox/x2/format/game/create/index.ts +1 -0
- package/src/smartfox/x2/format/game/create/request/index.ts +61 -0
- package/src/smartfox/x2/format/game/index.ts +14 -0
- package/src/smartfox/x2/format/game/invite/index.ts +2 -0
- package/src/smartfox/x2/format/game/invite/request/index.ts +50 -0
- package/src/smartfox/x2/format/game/invite/response/index.ts +61 -0
- package/src/smartfox/x2/format/game/join/index.ts +1 -0
- package/src/smartfox/x2/format/game/join/request/index.ts +55 -0
- package/src/smartfox/x2/format/game/quick/index.ts +2 -0
- package/src/smartfox/x2/format/game/quick/request/index.ts +56 -0
- package/src/smartfox/x2/format/game/quick/response/index.ts +48 -0
- package/src/smartfox/x2/format/game/reply/index.ts +2 -0
- package/src/smartfox/x2/format/game/reply/request/index.ts +50 -0
- package/src/smartfox/x2/format/game/reply/response/index.ts +70 -0
- package/src/smartfox/x2/format/group/index.ts +8 -0
- package/src/smartfox/x2/format/group/subscribe/index.ts +2 -0
- package/src/smartfox/x2/format/group/subscribe/request/index.ts +43 -0
- package/src/smartfox/x2/format/group/subscribe/response/index.ts +89 -0
- package/src/smartfox/x2/format/group/unsubscribe/index.ts +2 -0
- package/src/smartfox/x2/format/group/unsubscribe/request/index.ts +43 -0
- package/src/smartfox/x2/format/group/unsubscribe/response/index.ts +52 -0
- package/src/smartfox/x2/format/handshake/index.ts +2 -0
- package/src/smartfox/x2/format/handshake/request/index.ts +52 -0
- package/src/smartfox/x2/format/handshake/response/index.ts +62 -0
- package/src/smartfox/x2/format/index.ts +105 -0
- package/src/smartfox/x2/format/login/index.ts +2 -0
- package/src/smartfox/x2/format/login/request/index.ts +52 -0
- package/src/smartfox/x2/format/login/response/index.ts +99 -0
- package/src/smartfox/x2/format/logout/index.ts +2 -0
- package/src/smartfox/x2/format/logout/request/index.ts +38 -0
- package/src/smartfox/x2/format/logout/response/index.ts +42 -0
- package/src/smartfox/x2/format/message/index.ts +2 -0
- package/src/smartfox/x2/format/message/request/index.ts +126 -0
- package/src/smartfox/x2/format/message/response/index.ts +68 -0
- package/src/smartfox/x2/format/mmo/index.ts +4 -0
- package/src/smartfox/x2/format/mmo/position/index.ts +2 -0
- package/src/smartfox/x2/format/mmo/position/request/index.ts +49 -0
- package/src/smartfox/x2/format/mmo/position/response/index.ts +107 -0
- package/src/smartfox/x2/format/moderation/ban/index.ts +1 -0
- package/src/smartfox/x2/format/moderation/ban/request/index.ts +57 -0
- package/src/smartfox/x2/format/moderation/index.ts +2 -0
- package/src/smartfox/x2/format/moderation/kick/index.ts +1 -0
- package/src/smartfox/x2/format/moderation/kick/request/index.ts +48 -0
- package/src/smartfox/x2/format/ping/index.ts +2 -0
- package/src/smartfox/x2/format/ping/request/index.ts +38 -0
- package/src/smartfox/x2/format/ping/response/index.ts +38 -0
- package/src/smartfox/x2/format/room/capacity/index.ts +2 -0
- package/src/smartfox/x2/format/room/capacity/request/index.ts +50 -0
- package/src/smartfox/x2/format/room/capacity/response/index.ts +59 -0
- package/src/smartfox/x2/format/room/create/index.ts +2 -0
- package/src/smartfox/x2/format/room/create/request/index.ts +55 -0
- package/src/smartfox/x2/format/room/create/response/index.ts +55 -0
- package/src/smartfox/x2/format/room/index.ts +23 -0
- package/src/smartfox/x2/format/room/join/index.ts +2 -0
- package/src/smartfox/x2/format/room/join/request/index.ts +53 -0
- package/src/smartfox/x2/format/room/join/response/index.ts +84 -0
- package/src/smartfox/x2/format/room/leave/index.ts +1 -0
- package/src/smartfox/x2/format/room/leave/request/index.ts +42 -0
- package/src/smartfox/x2/format/room/password/index.ts +2 -0
- package/src/smartfox/x2/format/room/password/request/index.ts +46 -0
- package/src/smartfox/x2/format/room/password/response/index.ts +55 -0
- package/src/smartfox/x2/format/room/quick/index.ts +1 -0
- package/src/smartfox/x2/format/room/quick/request/index.ts +68 -0
- package/src/smartfox/x2/format/room/rename/index.ts +2 -0
- package/src/smartfox/x2/format/room/rename/request/index.ts +46 -0
- package/src/smartfox/x2/format/room/rename/response/index.ts +55 -0
- package/src/smartfox/x2/format/room/variables/index.ts +2 -0
- package/src/smartfox/x2/format/room/variables/request/index.ts +49 -0
- package/src/smartfox/x2/format/room/variables/response/index.ts +49 -0
- package/src/smartfox/x2/format/seat/index.ts +8 -0
- package/src/smartfox/x2/format/seat/player/index.ts +2 -0
- package/src/smartfox/x2/format/seat/player/request/index.ts +43 -0
- package/src/smartfox/x2/format/seat/player/response/index.ts +59 -0
- package/src/smartfox/x2/format/seat/spectator/index.ts +2 -0
- package/src/smartfox/x2/format/seat/spectator/request/index.ts +43 -0
- package/src/smartfox/x2/format/seat/spectator/response/index.ts +55 -0
- package/src/smartfox/x2/format/settings/index.ts +276 -0
- package/src/smartfox/x2/format/user/index.ts +4 -0
- package/src/smartfox/x2/format/user/variables/index.ts +2 -0
- package/src/smartfox/x2/format/user/variables/request/index.ts +46 -0
- package/src/smartfox/x2/format/user/variables/response/index.ts +49 -0
- package/src/smartfox/x2/games/index.ts +484 -0
- package/src/smartfox/x2/hall/index.ts +240 -0
- package/src/smartfox/x2/handler/buddy/index.ts +120 -0
- package/src/smartfox/x2/handler/chat/index.ts +213 -0
- package/src/smartfox/x2/handler/extension/index.ts +33 -0
- package/src/smartfox/x2/handler/game/index.ts +171 -0
- package/src/smartfox/x2/handler/index.ts +6 -0
- package/src/smartfox/x2/handler/room/index.ts +466 -0
- package/src/smartfox/x2/handler/session/index.ts +201 -0
- package/src/smartfox/x2/header/index.ts +25 -0
- package/src/smartfox/x2/index.ts +275 -0
- package/src/smartfox/x2/login/attempt/index.ts +102 -0
- package/src/smartfox/x2/login/index.ts +2 -0
- package/src/smartfox/x2/login/verdict/index.ts +81 -0
- package/src/smartfox/x2/member/index.ts +260 -0
- package/src/smartfox/x2/packet/buddy/add/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/add/request/index.ts +25 -0
- package/src/smartfox/x2/packet/buddy/add/response/index.ts +43 -0
- package/src/smartfox/x2/packet/buddy/block/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/block/request/index.ts +33 -0
- package/src/smartfox/x2/packet/buddy/block/response/index.ts +68 -0
- package/src/smartfox/x2/packet/buddy/index.ts +13 -0
- package/src/smartfox/x2/packet/buddy/init/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/init/request/index.ts +14 -0
- package/src/smartfox/x2/packet/buddy/init/response/index.ts +69 -0
- package/src/smartfox/x2/packet/buddy/online/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/online/request/index.ts +25 -0
- package/src/smartfox/x2/packet/buddy/online/response/index.ts +85 -0
- package/src/smartfox/x2/packet/buddy/remove/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/remove/request/index.ts +25 -0
- package/src/smartfox/x2/packet/buddy/remove/response/index.ts +42 -0
- package/src/smartfox/x2/packet/buddy/variables/index.ts +2 -0
- package/src/smartfox/x2/packet/buddy/variables/request/index.ts +29 -0
- package/src/smartfox/x2/packet/buddy/variables/response/index.ts +58 -0
- package/src/smartfox/x2/packet/cluster/connection/index.ts +1 -0
- package/src/smartfox/x2/packet/cluster/connection/response/index.ts +54 -0
- package/src/smartfox/x2/packet/cluster/error/index.ts +1 -0
- package/src/smartfox/x2/packet/cluster/error/response/index.ts +14 -0
- package/src/smartfox/x2/packet/cluster/index.ts +4 -0
- package/src/smartfox/x2/packet/cluster/invite/index.ts +1 -0
- package/src/smartfox/x2/packet/cluster/invite/request/index.ts +77 -0
- package/src/smartfox/x2/packet/cluster/join/index.ts +1 -0
- package/src/smartfox/x2/packet/cluster/join/request/index.ts +52 -0
- package/src/smartfox/x2/packet/disconnect/index.ts +1 -0
- package/src/smartfox/x2/packet/disconnect/request/index.ts +14 -0
- package/src/smartfox/x2/packet/error/codes/index.ts +231 -0
- package/src/smartfox/x2/packet/error/index.ts +69 -0
- package/src/smartfox/x2/packet/event/count/index.ts +45 -0
- package/src/smartfox/x2/packet/event/disconnection/index.ts +72 -0
- package/src/smartfox/x2/packet/event/enter/index.ts +47 -0
- package/src/smartfox/x2/packet/event/exit/index.ts +33 -0
- package/src/smartfox/x2/packet/event/index.ts +10 -0
- package/src/smartfox/x2/packet/event/item/index.ts +51 -0
- package/src/smartfox/x2/packet/event/lost/index.ts +2 -0
- package/src/smartfox/x2/packet/event/lost/room/index.ts +25 -0
- package/src/smartfox/x2/packet/event/lost/user/index.ts +25 -0
- package/src/smartfox/x2/packet/event/reconnection/index.ts +14 -0
- package/src/smartfox/x2/packet/extension/index.ts +2 -0
- package/src/smartfox/x2/packet/extension/request/index.ts +74 -0
- package/src/smartfox/x2/packet/extension/response/index.ts +54 -0
- package/src/smartfox/x2/packet/find/index.ts +2 -0
- package/src/smartfox/x2/packet/find/rooms/index.ts +2 -0
- package/src/smartfox/x2/packet/find/rooms/request/index.ts +51 -0
- package/src/smartfox/x2/packet/find/rooms/response/index.ts +27 -0
- package/src/smartfox/x2/packet/find/users/index.ts +2 -0
- package/src/smartfox/x2/packet/find/users/request/index.ts +89 -0
- package/src/smartfox/x2/packet/find/users/response/index.ts +27 -0
- package/src/smartfox/x2/packet/game/create/index.ts +1 -0
- package/src/smartfox/x2/packet/game/create/request/index.ts +27 -0
- package/src/smartfox/x2/packet/game/index.ts +8 -0
- package/src/smartfox/x2/packet/game/invite/index.ts +2 -0
- package/src/smartfox/x2/packet/game/invite/request/index.ts +51 -0
- package/src/smartfox/x2/packet/game/invite/response/index.ts +92 -0
- package/src/smartfox/x2/packet/game/join/index.ts +1 -0
- package/src/smartfox/x2/packet/game/join/request/index.ts +77 -0
- package/src/smartfox/x2/packet/game/quick/index.ts +2 -0
- package/src/smartfox/x2/packet/game/quick/request/index.ts +89 -0
- package/src/smartfox/x2/packet/game/quick/response/index.ts +34 -0
- package/src/smartfox/x2/packet/game/reply/index.ts +2 -0
- package/src/smartfox/x2/packet/game/reply/request/index.ts +51 -0
- package/src/smartfox/x2/packet/game/reply/response/index.ts +91 -0
- package/src/smartfox/x2/packet/group/index.ts +8 -0
- package/src/smartfox/x2/packet/group/subscribe/index.ts +2 -0
- package/src/smartfox/x2/packet/group/subscribe/request/index.ts +25 -0
- package/src/smartfox/x2/packet/group/subscribe/response/index.ts +58 -0
- package/src/smartfox/x2/packet/group/unsubscribe/index.ts +2 -0
- package/src/smartfox/x2/packet/group/unsubscribe/request/index.ts +25 -0
- package/src/smartfox/x2/packet/group/unsubscribe/response/index.ts +42 -0
- package/src/smartfox/x2/packet/handshake/index.ts +2 -0
- package/src/smartfox/x2/packet/handshake/request/index.ts +49 -0
- package/src/smartfox/x2/packet/handshake/response/index.ts +83 -0
- package/src/smartfox/x2/packet/index.ts +99 -0
- package/src/smartfox/x2/packet/login/index.ts +2 -0
- package/src/smartfox/x2/packet/login/request/index.ts +95 -0
- package/src/smartfox/x2/packet/login/response/index.ts +131 -0
- package/src/smartfox/x2/packet/logout/index.ts +2 -0
- package/src/smartfox/x2/packet/logout/request/index.ts +14 -0
- package/src/smartfox/x2/packet/logout/response/index.ts +25 -0
- package/src/smartfox/x2/packet/message/index.ts +4 -0
- package/src/smartfox/x2/packet/message/request/index.ts +241 -0
- package/src/smartfox/x2/packet/message/response/index.ts +216 -0
- package/src/smartfox/x2/packet/message/type/index.ts +56 -0
- package/src/smartfox/x2/packet/mmo/index.ts +5 -0
- package/src/smartfox/x2/packet/mmo/position/index.ts +3 -0
- package/src/smartfox/x2/packet/mmo/position/request/index.ts +38 -0
- package/src/smartfox/x2/packet/mmo/position/response/index.ts +114 -0
- package/src/smartfox/x2/packet/moderation/ban/index.ts +1 -0
- package/src/smartfox/x2/packet/moderation/ban/request/index.ts +83 -0
- package/src/smartfox/x2/packet/moderation/index.ts +2 -0
- package/src/smartfox/x2/packet/moderation/kick/index.ts +1 -0
- package/src/smartfox/x2/packet/moderation/kick/request/index.ts +45 -0
- package/src/smartfox/x2/packet/ping/index.ts +2 -0
- package/src/smartfox/x2/packet/ping/request/index.ts +14 -0
- package/src/smartfox/x2/packet/ping/response/index.ts +14 -0
- package/src/smartfox/x2/packet/room/capacity/index.ts +2 -0
- package/src/smartfox/x2/packet/room/capacity/request/index.ts +45 -0
- package/src/smartfox/x2/packet/room/capacity/response/index.ts +67 -0
- package/src/smartfox/x2/packet/room/create/index.ts +2 -0
- package/src/smartfox/x2/packet/room/create/request/index.ts +51 -0
- package/src/smartfox/x2/packet/room/create/response/index.ts +43 -0
- package/src/smartfox/x2/packet/room/index.ts +21 -0
- package/src/smartfox/x2/packet/room/join/index.ts +3 -0
- package/src/smartfox/x2/packet/room/join/request/index.ts +101 -0
- package/src/smartfox/x2/packet/room/join/response/index.ts +74 -0
- package/src/smartfox/x2/packet/room/leave/index.ts +1 -0
- package/src/smartfox/x2/packet/room/leave/request/index.ts +25 -0
- package/src/smartfox/x2/packet/room/password/index.ts +2 -0
- package/src/smartfox/x2/packet/room/password/request/index.ts +33 -0
- package/src/smartfox/x2/packet/room/password/response/index.ts +57 -0
- package/src/smartfox/x2/packet/room/quick/index.ts +1 -0
- package/src/smartfox/x2/packet/room/quick/request/index.ts +67 -0
- package/src/smartfox/x2/packet/room/rename/index.ts +2 -0
- package/src/smartfox/x2/packet/room/rename/request/index.ts +33 -0
- package/src/smartfox/x2/packet/room/rename/response/index.ts +50 -0
- package/src/smartfox/x2/packet/room/variables/index.ts +2 -0
- package/src/smartfox/x2/packet/room/variables/request/index.ts +38 -0
- package/src/smartfox/x2/packet/room/variables/response/index.ts +38 -0
- package/src/smartfox/x2/packet/seat/index.ts +8 -0
- package/src/smartfox/x2/packet/seat/player/index.ts +2 -0
- package/src/smartfox/x2/packet/seat/player/request/index.ts +25 -0
- package/src/smartfox/x2/packet/seat/player/response/index.ts +67 -0
- package/src/smartfox/x2/packet/seat/spectator/index.ts +2 -0
- package/src/smartfox/x2/packet/seat/spectator/request/index.ts +25 -0
- package/src/smartfox/x2/packet/seat/spectator/response/index.ts +50 -0
- package/src/smartfox/x2/packet/unknown/index.ts +47 -0
- package/src/smartfox/x2/packet/user/index.ts +4 -0
- package/src/smartfox/x2/packet/user/variables/index.ts +2 -0
- package/src/smartfox/x2/packet/user/variables/request/index.ts +29 -0
- package/src/smartfox/x2/packet/user/variables/response/index.ts +38 -0
- package/src/smartfox/x2/protocol/index.ts +495 -0
- package/src/smartfox/x2/proximity/index.ts +353 -0
- package/src/smartfox/x2/rooms/index.ts +981 -0
- package/src/smartfox/x2/roster/index.ts +3 -0
- package/src/smartfox/x2/roster/memory/index.ts +41 -0
- package/src/smartfox/x2/roster/record/index.ts +31 -0
- package/src/smartfox/x2/roster/store/index.ts +21 -0
- package/src/smartfox/x2/route/index.ts +17 -0
- package/src/smartfox/x2/sessions/index.ts +18 -0
- package/src/smartfox/x2/udp/index.ts +392 -0
- package/src/smartfox/x2/web/index.ts +183 -0
- package/src/smartfox/x2/websocket/index.ts +119 -0
- package/src/smartfox/x2/words/index.ts +265 -0
- package/src/smartfox/x2/zone/index.ts +1163 -0
- package/src/smartfox/x2/zones/index.ts +608 -0
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { AutoRemove, type RoomConfig } from '../config/index.ts'
|
|
2
|
+
import type { MatchExpression } from '../entity/match/index.ts'
|
|
3
|
+
import { Room } from '../entity/room/index.ts'
|
|
4
|
+
import type { RoomSettings } from '../entity/settings/index.ts'
|
|
5
|
+
import { RoomVariable } from '../entity/variable/room/index.ts'
|
|
6
|
+
import { VariableType } from '../entity/variable/type/index.ts'
|
|
7
|
+
import type { UserVariable } from '../entity/variable/user/index.ts'
|
|
8
|
+
import { Hall } from '../hall/index.ts'
|
|
9
|
+
import type { Member } from '../member/index.ts'
|
|
10
|
+
import { ErrorCode } from '../packet/error/codes/index.ts'
|
|
11
|
+
import type { SfsError } from '../packet/error/index.ts'
|
|
12
|
+
import { UserEnterRoomEvent } from '../packet/event/enter/index.ts'
|
|
13
|
+
import { UserExitRoomEvent } from '../packet/event/exit/index.ts'
|
|
14
|
+
import { RoomLostEvent } from '../packet/event/lost/room/index.ts'
|
|
15
|
+
import { ChangeRoomCapacityResponse } from '../packet/room/capacity/response/index.ts'
|
|
16
|
+
import { CreateRoomResponse } from '../packet/room/create/response/index.ts'
|
|
17
|
+
import {
|
|
18
|
+
JoinRoomResponse,
|
|
19
|
+
type Occupant,
|
|
20
|
+
} from '../packet/room/join/response/index.ts'
|
|
21
|
+
import { ChangeRoomPasswordResponse } from '../packet/room/password/response/index.ts'
|
|
22
|
+
import { ChangeRoomNameResponse } from '../packet/room/rename/response/index.ts'
|
|
23
|
+
import { SetRoomVariablesResponse } from '../packet/room/variables/response/index.ts'
|
|
24
|
+
import { SpectatorToPlayerResponse } from '../packet/seat/player/response/index.ts'
|
|
25
|
+
import { PlayerToSpectatorResponse } from '../packet/seat/spectator/response/index.ts'
|
|
26
|
+
import { SetUserVariablesResponse } from '../packet/user/variables/response/index.ts'
|
|
27
|
+
import type { Zone } from '../zone/index.ts'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* How a join differs from the plain case
|
|
31
|
+
*/
|
|
32
|
+
export type JoinOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* What the user typed as the password
|
|
35
|
+
*/
|
|
36
|
+
readonly password?: string | null
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether they come to watch
|
|
40
|
+
*/
|
|
41
|
+
readonly spectator?: boolean
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Room to leave afterwards, null for the last one joined, negative for none
|
|
45
|
+
*/
|
|
46
|
+
readonly roomToLeave?: number | null
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether the password and access rules are skipped
|
|
50
|
+
*/
|
|
51
|
+
readonly forced?: boolean
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Creating, joining, leaving and changing a zone's rooms
|
|
56
|
+
* @class
|
|
57
|
+
*/
|
|
58
|
+
export class Rooms {
|
|
59
|
+
/**
|
|
60
|
+
* Room variable that says whether a managed game is under way
|
|
61
|
+
*/
|
|
62
|
+
public static readonly gameStarted: string = '$GS'
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The zone the rooms are in
|
|
66
|
+
*/
|
|
67
|
+
private readonly zone: Zone
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param zone the zone the rooms are in
|
|
71
|
+
*/
|
|
72
|
+
public constructor(zone: Zone) {
|
|
73
|
+
this.zone = zone
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Opens a room from the config
|
|
78
|
+
* @param config what the room is like
|
|
79
|
+
*/
|
|
80
|
+
public open(config: RoomConfig): Hall {
|
|
81
|
+
const room = Room.of(
|
|
82
|
+
this.zone.roomIds.next(),
|
|
83
|
+
config.name,
|
|
84
|
+
config.groupId ?? Room.defaultGroup,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
room.password = config.password ?? ''
|
|
88
|
+
room.passwordProtected = room.password !== ''
|
|
89
|
+
room.maxUsers = config.maxUsers ?? 20
|
|
90
|
+
room.maxSpectators = config.maxSpectators ?? 0
|
|
91
|
+
room.maxVariables = config.maxVariables ?? this.zone.maxRoomVariables
|
|
92
|
+
room.game = config.game ?? false
|
|
93
|
+
room.hidden = config.hidden ?? false
|
|
94
|
+
room.permissions = { ...room.permissions, ...config.permissions }
|
|
95
|
+
room.events = { ...room.events, ...config.events }
|
|
96
|
+
if (config.mmo !== undefined) {
|
|
97
|
+
room.mmo = {
|
|
98
|
+
lowerLimit: null,
|
|
99
|
+
higherLimit: null,
|
|
100
|
+
userMaxLimboSeconds: 50,
|
|
101
|
+
proximityListUpdateMillis: 250,
|
|
102
|
+
sendAOIEntryPoint: true,
|
|
103
|
+
...config.mmo,
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const hall = Hall.of(room)
|
|
108
|
+
hall.autoRemove = AutoRemove.NEVER_REMOVE
|
|
109
|
+
for (const variable of config.variables ?? []) {
|
|
110
|
+
room.variables.set(
|
|
111
|
+
variable.name,
|
|
112
|
+
RoomVariable.of(
|
|
113
|
+
variable.name,
|
|
114
|
+
variable.value,
|
|
115
|
+
variable.private ?? false,
|
|
116
|
+
true,
|
|
117
|
+
),
|
|
118
|
+
)
|
|
119
|
+
hall.owners.set(variable.name, -1)
|
|
120
|
+
if (variable.global === true) hall.globals.add(variable.name)
|
|
121
|
+
if (variable.hidden === true) hall.secret.add(variable.name)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
this.zone.enlist(hall)
|
|
125
|
+
return hall
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The rooms of some groups as room lists show them
|
|
130
|
+
* @param groups group ids to include
|
|
131
|
+
*/
|
|
132
|
+
public listing(groups: Iterable<string>): Room[] {
|
|
133
|
+
const wanted = new Set<string>(groups)
|
|
134
|
+
|
|
135
|
+
return [...this.zone.halls.values()]
|
|
136
|
+
.filter(
|
|
137
|
+
(hall: Hall): boolean =>
|
|
138
|
+
!hall.room.hidden && wanted.has(hall.room.groupId),
|
|
139
|
+
)
|
|
140
|
+
.map((hall: Hall): Room => hall.listed())
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Makes a room at a client's request, or says why not
|
|
145
|
+
* @param settings what the room should be like
|
|
146
|
+
* @param owner who asked for it, null for the server
|
|
147
|
+
*/
|
|
148
|
+
public create(settings: RoomSettings, owner: Member | null): Hall | SfsError {
|
|
149
|
+
const error = this.creationRefusal(settings, owner)
|
|
150
|
+
if (error !== null) return error
|
|
151
|
+
|
|
152
|
+
const room = Room.of(
|
|
153
|
+
this.zone.roomIds.next(),
|
|
154
|
+
settings.name,
|
|
155
|
+
settings.groupId,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
room.password = settings.password
|
|
159
|
+
room.passwordProtected = settings.password !== ''
|
|
160
|
+
room.game = settings.isGame || settings.game !== null
|
|
161
|
+
room.maxUsers = settings.maxUsers
|
|
162
|
+
room.maxSpectators = settings.maxSpectators
|
|
163
|
+
room.maxVariables = Math.min(
|
|
164
|
+
settings.maxVariables,
|
|
165
|
+
this.zone.maxRoomVariables,
|
|
166
|
+
)
|
|
167
|
+
room.owner = owner?.id ?? -1
|
|
168
|
+
room.dynamic = true
|
|
169
|
+
room.allowOwnerOnlyInvitation = settings.allowOwnerOnlyInvitation
|
|
170
|
+
room.permissions = settings.permissions ?? {
|
|
171
|
+
allowNameChange: true,
|
|
172
|
+
allowPasswordStateChange: true,
|
|
173
|
+
allowPublicMessages: true,
|
|
174
|
+
allowResizing: true,
|
|
175
|
+
}
|
|
176
|
+
room.events = settings.events ?? room.events
|
|
177
|
+
room.extension = settings.extension
|
|
178
|
+
room.mmo = settings.mmo
|
|
179
|
+
room.gameSettings = settings.game
|
|
180
|
+
|
|
181
|
+
const hall = Hall.of(room)
|
|
182
|
+
hall.creator = owner?.name ?? null
|
|
183
|
+
for (const variable of settings.variables.slice(0, room.maxVariables)) {
|
|
184
|
+
if (variable.type === VariableType.NULL) continue
|
|
185
|
+
|
|
186
|
+
room.variables.set(variable.name, variable)
|
|
187
|
+
hall.owners.set(variable.name, room.owner)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (settings.game?.notifyGameStarted === true) {
|
|
191
|
+
room.variables.set(
|
|
192
|
+
Rooms.gameStarted,
|
|
193
|
+
RoomVariable.of(Rooms.gameStarted, false, true, true),
|
|
194
|
+
)
|
|
195
|
+
hall.owners.set(Rooms.gameStarted, -1)
|
|
196
|
+
hall.globals.add(Rooms.gameStarted)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (owner !== null) owner.created += 1
|
|
200
|
+
this.zone.enlist(hall)
|
|
201
|
+
|
|
202
|
+
const audience = this.zone.audience(hall)
|
|
203
|
+
if (owner !== null) audience.add(owner)
|
|
204
|
+
this.zone.tell(audience, CreateRoomResponse.success(hall.listed()))
|
|
205
|
+
|
|
206
|
+
return hall
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Lets a user into a room, or says why not
|
|
211
|
+
* @param member who's joining
|
|
212
|
+
* @param hall the room
|
|
213
|
+
* @param options how the join differs from the plain case
|
|
214
|
+
*/
|
|
215
|
+
public join(
|
|
216
|
+
member: Member,
|
|
217
|
+
hall: Hall,
|
|
218
|
+
options: JoinOptions = {},
|
|
219
|
+
): SfsError | null {
|
|
220
|
+
const spectator = options.spectator ?? false
|
|
221
|
+
const forced = options.forced ?? hall.invited.has(member.id)
|
|
222
|
+
|
|
223
|
+
const error = this.joinRefusal(member, hall, options, spectator, forced)
|
|
224
|
+
if (error !== null) return error
|
|
225
|
+
|
|
226
|
+
const previous = member.lastJoined
|
|
227
|
+
const playerId = hall.enter(member, spectator)
|
|
228
|
+
this.zone.hear(member, hall)
|
|
229
|
+
hall.invited.delete(member.id)
|
|
230
|
+
member.lastJoined = hall.id
|
|
231
|
+
|
|
232
|
+
const mmo = hall.room.mmo !== null
|
|
233
|
+
const occupants: Occupant[] = mmo
|
|
234
|
+
? [{ user: member.view(playerId, true), playerId }]
|
|
235
|
+
: [...hall.members.values()].map((other: Member): Occupant => {
|
|
236
|
+
const seat = other.rooms.get(hall.id) ?? 0
|
|
237
|
+
|
|
238
|
+
return { user: other.view(seat, other === member), playerId: seat }
|
|
239
|
+
})
|
|
240
|
+
member.send(JoinRoomResponse.success(hall.detailed(), occupants))
|
|
241
|
+
|
|
242
|
+
if (mmo) this.zone.proximity.arrive(member, hall)
|
|
243
|
+
else if (hall.room.events.allowUserEnter) {
|
|
244
|
+
this.zone.tell(
|
|
245
|
+
hall.members.values(),
|
|
246
|
+
UserEnterRoomEvent.of(hall.id, member.view(playerId), playerId),
|
|
247
|
+
member,
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
this.zone.recount(hall)
|
|
252
|
+
this.started(hall)
|
|
253
|
+
|
|
254
|
+
const leaving = options.roomToLeave ?? previous
|
|
255
|
+
const old =
|
|
256
|
+
leaving === null || leaving < 0 || leaving === hall.id
|
|
257
|
+
? null
|
|
258
|
+
: this.zone.hall(leaving)
|
|
259
|
+
if (old !== null) this.leave(member, old)
|
|
260
|
+
|
|
261
|
+
return null
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Takes a user out of a room and tells everyone inside
|
|
266
|
+
* @param member who's leaving
|
|
267
|
+
* @param hall the room
|
|
268
|
+
*/
|
|
269
|
+
public leave(member: Member, hall: Hall): boolean {
|
|
270
|
+
if (!hall.members.has(member.id)) return false
|
|
271
|
+
|
|
272
|
+
const witnesses = hall.room.events.allowUserExit
|
|
273
|
+
? this.witnesses(member, hall)
|
|
274
|
+
: new Set<Member>()
|
|
275
|
+
witnesses.add(member)
|
|
276
|
+
|
|
277
|
+
this.zone.tell(witnesses, UserExitRoomEvent.of(hall.id, member.id))
|
|
278
|
+
this.release(member, hall)
|
|
279
|
+
|
|
280
|
+
return true
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Everyone in a room who can see a user
|
|
285
|
+
* @param member who's being looked at
|
|
286
|
+
* @param hall the room
|
|
287
|
+
*/
|
|
288
|
+
public witnesses(member: Member, hall: Hall): Set<Member> {
|
|
289
|
+
if (hall.room.mmo === null) return new Set<Member>(hall.members.values())
|
|
290
|
+
|
|
291
|
+
return this.zone.proximity.watchers(member, hall)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Takes a user out of a room without telling the room they left
|
|
296
|
+
* @param member who's leaving
|
|
297
|
+
* @param hall the room
|
|
298
|
+
*/
|
|
299
|
+
public release(member: Member, hall: Hall): void {
|
|
300
|
+
if (hall.room.mmo !== null) this.zone.proximity.vanish(member, hall)
|
|
301
|
+
if (!hall.exit(member)) return
|
|
302
|
+
|
|
303
|
+
this.zone.unhear(member, hall)
|
|
304
|
+
|
|
305
|
+
if (member.lastJoined === hall.id) {
|
|
306
|
+
member.lastJoined = [...member.rooms.keys()].at(-1) ?? null
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const dropped: RoomVariable[] = []
|
|
310
|
+
for (const [name, owner] of hall.owners) {
|
|
311
|
+
const variable = hall.room.variables.get(name)
|
|
312
|
+
if (owner !== member.id || variable === undefined) continue
|
|
313
|
+
if (variable.persistent && this.zone.find(member.id) !== null) continue
|
|
314
|
+
|
|
315
|
+
hall.room.variables.delete(name)
|
|
316
|
+
hall.owners.delete(name)
|
|
317
|
+
dropped.push(RoomVariable.of(name, null))
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (dropped.length > 0) this.announce(hall, dropped)
|
|
321
|
+
|
|
322
|
+
this.zone.recount(hall)
|
|
323
|
+
this.started(hall)
|
|
324
|
+
this.reap(hall)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Removes the rooms a user who's gone left behind
|
|
329
|
+
* @param member who left the zone
|
|
330
|
+
*/
|
|
331
|
+
public orphan(member: Member): void {
|
|
332
|
+
for (const hall of [...this.zone.halls.values()]) {
|
|
333
|
+
if (hall.creator !== member.name) continue
|
|
334
|
+
|
|
335
|
+
const dropped: RoomVariable[] = []
|
|
336
|
+
for (const [name, owner] of hall.owners) {
|
|
337
|
+
if (owner !== member.id) continue
|
|
338
|
+
|
|
339
|
+
hall.room.variables.delete(name)
|
|
340
|
+
hall.owners.delete(name)
|
|
341
|
+
dropped.push(RoomVariable.of(name, null))
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if (dropped.length > 0) this.announce(hall, dropped)
|
|
345
|
+
|
|
346
|
+
hall.creator = null
|
|
347
|
+
this.reap(hall)
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Takes a room away and tells everyone who knew about it
|
|
353
|
+
* @param hall the room
|
|
354
|
+
*/
|
|
355
|
+
public remove(hall: Hall): void {
|
|
356
|
+
if (this.zone.hall(hall.id) !== hall) return
|
|
357
|
+
|
|
358
|
+
const audience = this.zone.audience(hall)
|
|
359
|
+
for (const member of [...hall.members.values()]) {
|
|
360
|
+
if (hall.room.mmo !== null) this.zone.proximity.vanish(member, hall)
|
|
361
|
+
hall.exit(member)
|
|
362
|
+
this.zone.unhear(member, hall)
|
|
363
|
+
if (member.lastJoined === hall.id) {
|
|
364
|
+
member.lastJoined = [...member.rooms.keys()].at(-1) ?? null
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (hall.counting !== null) clearTimeout(hall.counting)
|
|
369
|
+
this.zone.delist(hall)
|
|
370
|
+
this.zone.games.close(hall)
|
|
371
|
+
this.zone.tell(audience, RoomLostEvent.of(hall.id))
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Renames a room, or says why not
|
|
376
|
+
* @param member who's asking
|
|
377
|
+
* @param hall the room
|
|
378
|
+
* @param name what it should be called
|
|
379
|
+
*/
|
|
380
|
+
public rename(member: Member, hall: Hall, name: string): SfsError | null {
|
|
381
|
+
if (!hall.room.permissions.allowNameChange || !this.owns(member, hall)) {
|
|
382
|
+
return this.zone.error(
|
|
383
|
+
ErrorCode.ROOM_NAME_CHANGE_PERMISSION_ERR,
|
|
384
|
+
hall.name,
|
|
385
|
+
)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const error = this.nameRefusal(name)
|
|
389
|
+
if (error !== null) return error
|
|
390
|
+
|
|
391
|
+
this.zone.rename(hall, name)
|
|
392
|
+
this.zone.tell(
|
|
393
|
+
this.zone.audience(hall),
|
|
394
|
+
ChangeRoomNameResponse.success(hall.id, name),
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
return null
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Sets or clears a room's password, or says why not
|
|
402
|
+
* @param member who's asking
|
|
403
|
+
* @param hall the room
|
|
404
|
+
* @param password the new password, empty for none
|
|
405
|
+
*/
|
|
406
|
+
public lock(member: Member, hall: Hall, password: string): SfsError | null {
|
|
407
|
+
if (
|
|
408
|
+
!hall.room.permissions.allowPasswordStateChange ||
|
|
409
|
+
!this.owns(member, hall)
|
|
410
|
+
) {
|
|
411
|
+
return this.zone.error(
|
|
412
|
+
ErrorCode.ROOM_PASS_CHANGE_PERMISSION_ERR,
|
|
413
|
+
hall.name,
|
|
414
|
+
)
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const before = hall.room.passwordProtected
|
|
418
|
+
hall.room.password = password
|
|
419
|
+
hall.room.passwordProtected = password !== ''
|
|
420
|
+
|
|
421
|
+
const packet = ChangeRoomPasswordResponse.success(
|
|
422
|
+
hall.id,
|
|
423
|
+
hall.room.passwordProtected,
|
|
424
|
+
)
|
|
425
|
+
if (before === hall.room.passwordProtected) member.send(packet)
|
|
426
|
+
else this.zone.tell(this.zone.audience(hall), packet)
|
|
427
|
+
|
|
428
|
+
return null
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Changes how many a room holds, or says why not
|
|
433
|
+
* @param member who's asking
|
|
434
|
+
* @param hall the room
|
|
435
|
+
* @param maxUsers most players
|
|
436
|
+
* @param maxSpectators most spectators
|
|
437
|
+
*/
|
|
438
|
+
public resize(
|
|
439
|
+
member: Member,
|
|
440
|
+
hall: Hall,
|
|
441
|
+
maxUsers: number,
|
|
442
|
+
maxSpectators: number,
|
|
443
|
+
): SfsError | null {
|
|
444
|
+
if (!hall.room.permissions.allowResizing || !this.owns(member, hall)) {
|
|
445
|
+
return this.zone.error(
|
|
446
|
+
ErrorCode.ROOM_CAPACITY_CHANGE_PERMISSION_ERR,
|
|
447
|
+
hall.name,
|
|
448
|
+
)
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (maxUsers > 0) hall.room.maxUsers = maxUsers
|
|
452
|
+
if (maxSpectators >= 0) hall.room.maxSpectators = maxSpectators
|
|
453
|
+
|
|
454
|
+
this.zone.tell(
|
|
455
|
+
this.zone.audience(hall),
|
|
456
|
+
ChangeRoomCapacityResponse.success(
|
|
457
|
+
hall.id,
|
|
458
|
+
hall.room.maxUsers,
|
|
459
|
+
hall.room.maxSpectators,
|
|
460
|
+
),
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
return null
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Sets room variables and tells whoever can see them
|
|
468
|
+
* @param hall the room
|
|
469
|
+
* @param variables what to set, a null value deletes
|
|
470
|
+
* @param member who's setting them, null for the server
|
|
471
|
+
*/
|
|
472
|
+
public setVariables(
|
|
473
|
+
hall: Hall,
|
|
474
|
+
variables: readonly RoomVariable[],
|
|
475
|
+
member: Member | null = null,
|
|
476
|
+
): void {
|
|
477
|
+
const owner = member?.id ?? -1
|
|
478
|
+
const changed: RoomVariable[] = []
|
|
479
|
+
|
|
480
|
+
for (const variable of variables) {
|
|
481
|
+
const known = hall.room.variables.get(variable.name)
|
|
482
|
+
const locked =
|
|
483
|
+
member !== null &&
|
|
484
|
+
known?.hidden === true &&
|
|
485
|
+
hall.owners.get(variable.name) !== owner
|
|
486
|
+
if (locked) continue
|
|
487
|
+
|
|
488
|
+
if (variable.type === VariableType.NULL) {
|
|
489
|
+
if (known === undefined) continue
|
|
490
|
+
|
|
491
|
+
hall.room.variables.delete(variable.name)
|
|
492
|
+
hall.owners.delete(variable.name)
|
|
493
|
+
changed.push(variable)
|
|
494
|
+
continue
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (
|
|
498
|
+
known === undefined &&
|
|
499
|
+
hall.room.variables.size >= hall.room.maxVariables
|
|
500
|
+
) {
|
|
501
|
+
continue
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
hall.room.variables.set(variable.name, variable)
|
|
505
|
+
if (known === undefined) hall.owners.set(variable.name, owner)
|
|
506
|
+
changed.push(variable)
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (changed.length > 0) this.announce(hall, changed)
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Gives a spectator a player seat, or says why not
|
|
514
|
+
* @param member who's switching
|
|
515
|
+
* @param hall the room
|
|
516
|
+
*/
|
|
517
|
+
public toPlayer(member: Member, hall: Hall): SfsError | null {
|
|
518
|
+
const error = this.switchRefusal(member, hall)
|
|
519
|
+
if (error !== null) return error
|
|
520
|
+
|
|
521
|
+
const seat = hall.seat()
|
|
522
|
+
if (seat === null || (member.rooms.get(hall.id) ?? 0) > 0) {
|
|
523
|
+
return this.zone.error(
|
|
524
|
+
ErrorCode.SWITCH_NO_PLAYER_SLOTS_AVAILABLE,
|
|
525
|
+
hall.name,
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
hall.reseat(member, seat)
|
|
530
|
+
this.zone.tell(
|
|
531
|
+
hall.members.values(),
|
|
532
|
+
SpectatorToPlayerResponse.success(hall.id, member.id, seat),
|
|
533
|
+
)
|
|
534
|
+
this.zone.recount(hall)
|
|
535
|
+
this.started(hall)
|
|
536
|
+
|
|
537
|
+
return null
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Moves a player to the spectators, or says why not
|
|
542
|
+
* @param member who's switching
|
|
543
|
+
* @param hall the room
|
|
544
|
+
*/
|
|
545
|
+
public toSpectator(member: Member, hall: Hall): SfsError | null {
|
|
546
|
+
const error = this.switchRefusal(member, hall)
|
|
547
|
+
if (error !== null) return error
|
|
548
|
+
|
|
549
|
+
if ((member.rooms.get(hall.id) ?? 0) <= 0 || !hall.fits(true)) {
|
|
550
|
+
return this.zone.error(
|
|
551
|
+
ErrorCode.SWITCH_NO_SPECTATOR_SLOTS_AVAILABLE,
|
|
552
|
+
hall.name,
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
hall.reseat(member, Hall.spectator)
|
|
557
|
+
this.zone.tell(
|
|
558
|
+
hall.members.values(),
|
|
559
|
+
PlayerToSpectatorResponse.success(hall.id, member.id),
|
|
560
|
+
)
|
|
561
|
+
this.zone.recount(hall)
|
|
562
|
+
this.started(hall)
|
|
563
|
+
|
|
564
|
+
return null
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Rooms an expression picks
|
|
569
|
+
* @param expression what to look for
|
|
570
|
+
* @param group group to look in, null for every group
|
|
571
|
+
* @param limit most results, 0 for no limit
|
|
572
|
+
*/
|
|
573
|
+
public find(
|
|
574
|
+
expression: MatchExpression,
|
|
575
|
+
group: string | null = null,
|
|
576
|
+
limit = 0,
|
|
577
|
+
): Hall[] {
|
|
578
|
+
const found: Hall[] = []
|
|
579
|
+
|
|
580
|
+
for (const hall of this.zone.halls.values()) {
|
|
581
|
+
if (hall.room.hidden) continue
|
|
582
|
+
if (group !== null && group !== '' && hall.room.groupId !== group) {
|
|
583
|
+
continue
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (!this.matches(hall, expression)) continue
|
|
587
|
+
|
|
588
|
+
found.push(hall)
|
|
589
|
+
if (limit > 0 && found.length >= limit) break
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return found
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Whether a room satisfies an expression
|
|
597
|
+
* @param hall the room
|
|
598
|
+
* @param expression what to look for
|
|
599
|
+
*/
|
|
600
|
+
public matches(hall: Hall, expression: MatchExpression): boolean {
|
|
601
|
+
const room = hall.room
|
|
602
|
+
|
|
603
|
+
return expression.matches(
|
|
604
|
+
(name: string): boolean | number | string | null => {
|
|
605
|
+
switch (name) {
|
|
606
|
+
case '${N}':
|
|
607
|
+
return room.name
|
|
608
|
+
case '${G}':
|
|
609
|
+
return room.groupId
|
|
610
|
+
case '${MXU}':
|
|
611
|
+
return room.maxUsers
|
|
612
|
+
case '${MXS}':
|
|
613
|
+
return room.maxSpectators
|
|
614
|
+
case '${UC}':
|
|
615
|
+
return room.userCount
|
|
616
|
+
case '${SC}':
|
|
617
|
+
return room.spectatorCount
|
|
618
|
+
case '${ISG}':
|
|
619
|
+
return room.game
|
|
620
|
+
case '${ISP}':
|
|
621
|
+
return room.passwordProtected
|
|
622
|
+
case '${HFP}':
|
|
623
|
+
return room.userCount < room.maxUsers
|
|
624
|
+
case '${IST}':
|
|
625
|
+
return room.gameSettings !== null
|
|
626
|
+
case '${ISM}':
|
|
627
|
+
return room.mmo !== null
|
|
628
|
+
case '${ISD}':
|
|
629
|
+
return room.gameSettings === null && room.mmo === null
|
|
630
|
+
default:
|
|
631
|
+
return this.plain(room.variables.get(name))
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
)
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Sets a user's variables and tells whoever can see them
|
|
639
|
+
* @param member whose variables they are
|
|
640
|
+
* @param variables what to set, a null value deletes
|
|
641
|
+
*/
|
|
642
|
+
public setUserVariables(
|
|
643
|
+
member: Member,
|
|
644
|
+
variables: readonly UserVariable[],
|
|
645
|
+
): void {
|
|
646
|
+
const changed: UserVariable[] = []
|
|
647
|
+
|
|
648
|
+
for (const variable of variables) {
|
|
649
|
+
const known = member.variables.has(variable.name)
|
|
650
|
+
|
|
651
|
+
if (variable.type === VariableType.NULL) {
|
|
652
|
+
if (member.variables.delete(variable.name)) changed.push(variable)
|
|
653
|
+
continue
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (!known && member.variables.size >= this.zone.maxUserVariables) {
|
|
657
|
+
continue
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
member.variables.set(variable.name, variable)
|
|
661
|
+
changed.push(variable)
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (changed.length === 0) return
|
|
665
|
+
|
|
666
|
+
member.send(SetUserVariablesResponse.of(member.id, changed))
|
|
667
|
+
|
|
668
|
+
const open = changed.filter(
|
|
669
|
+
(variable: UserVariable): boolean => !variable.hidden,
|
|
670
|
+
)
|
|
671
|
+
if (open.length === 0) return
|
|
672
|
+
|
|
673
|
+
const witnesses = new Set<Member>()
|
|
674
|
+
for (const id of member.rooms.keys()) {
|
|
675
|
+
const hall = this.zone.hall(id)
|
|
676
|
+
if (hall?.room.events.allowUserVariablesUpdate !== true) continue
|
|
677
|
+
|
|
678
|
+
for (const witness of this.witnesses(member, hall)) {
|
|
679
|
+
witnesses.add(witness)
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
this.zone.tell(
|
|
684
|
+
witnesses,
|
|
685
|
+
SetUserVariablesResponse.of(member.id, open),
|
|
686
|
+
member,
|
|
687
|
+
)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Users an expression picks
|
|
692
|
+
* @param expression what to look for
|
|
693
|
+
* @param candidates who to look through
|
|
694
|
+
* @param limit most results, 0 for no limit
|
|
695
|
+
*/
|
|
696
|
+
public findUsers(
|
|
697
|
+
expression: MatchExpression,
|
|
698
|
+
candidates: Iterable<Member>,
|
|
699
|
+
limit = 0,
|
|
700
|
+
): Member[] {
|
|
701
|
+
const found: Member[] = []
|
|
702
|
+
|
|
703
|
+
for (const member of candidates) {
|
|
704
|
+
if (!this.matchesUser(member, expression)) continue
|
|
705
|
+
|
|
706
|
+
found.push(member)
|
|
707
|
+
if (limit > 0 && found.length >= limit) break
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return found
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Whether a user satisfies an expression
|
|
715
|
+
* @param member the user
|
|
716
|
+
* @param expression what to look for
|
|
717
|
+
*/
|
|
718
|
+
public matchesUser(member: Member, expression: MatchExpression): boolean {
|
|
719
|
+
const seats = [...member.rooms.values()]
|
|
720
|
+
|
|
721
|
+
return expression.matches(
|
|
722
|
+
(name: string): boolean | number | string | null => {
|
|
723
|
+
switch (name) {
|
|
724
|
+
case '${N}':
|
|
725
|
+
return member.name
|
|
726
|
+
case '${ISP}':
|
|
727
|
+
return seats.some((seat: number): boolean => seat > 0)
|
|
728
|
+
case '${ISS}':
|
|
729
|
+
return seats.some((seat: number): boolean => seat < 0)
|
|
730
|
+
case '${ISN}':
|
|
731
|
+
return false
|
|
732
|
+
case '${PRID}':
|
|
733
|
+
return member.privilege
|
|
734
|
+
case '${IAR}':
|
|
735
|
+
return seats.length > 0
|
|
736
|
+
default:
|
|
737
|
+
return this.plain(member.variables.get(name))
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
)
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Tells a room, and its group for global ones, that variables changed
|
|
745
|
+
* @param hall the room
|
|
746
|
+
* @param changed the variables that changed
|
|
747
|
+
*/
|
|
748
|
+
private announce(hall: Hall, changed: readonly RoomVariable[]): void {
|
|
749
|
+
const visible = hall.visible(changed)
|
|
750
|
+
if (visible.length === 0) return
|
|
751
|
+
|
|
752
|
+
this.zone.tell(
|
|
753
|
+
hall.members.values(),
|
|
754
|
+
SetRoomVariablesResponse.of(hall.id, visible),
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
const global = visible.filter((variable: RoomVariable): boolean =>
|
|
758
|
+
hall.globals.has(variable.name),
|
|
759
|
+
)
|
|
760
|
+
if (global.length === 0 || hall.room.hidden) return
|
|
761
|
+
|
|
762
|
+
const packet = SetRoomVariablesResponse.of(hall.id, global)
|
|
763
|
+
for (const member of this.zone.subscribers(hall.room.groupId)) {
|
|
764
|
+
if (!hall.members.has(member.id)) member.send(packet)
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* A variable's value if an expression can compare it, or null
|
|
770
|
+
* @param variable a room or user variable, if there is one
|
|
771
|
+
*/
|
|
772
|
+
private plain(
|
|
773
|
+
variable: RoomVariable | UserVariable | undefined,
|
|
774
|
+
): boolean | number | string | null {
|
|
775
|
+
const value = variable?.value
|
|
776
|
+
|
|
777
|
+
return typeof value === 'boolean' ||
|
|
778
|
+
typeof value === 'number' ||
|
|
779
|
+
typeof value === 'string'
|
|
780
|
+
? value
|
|
781
|
+
: null
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Whether a user may change a room's name, password or size
|
|
786
|
+
* @param member who's asking
|
|
787
|
+
* @param hall the room
|
|
788
|
+
*/
|
|
789
|
+
private owns(member: Member, hall: Hall): boolean {
|
|
790
|
+
return (
|
|
791
|
+
hall.room.owner === member.id ||
|
|
792
|
+
this.zone.profile(member.privilege).superUser
|
|
793
|
+
)
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Keeps a managed game's started flag in step with its players
|
|
798
|
+
* @param hall the room
|
|
799
|
+
*/
|
|
800
|
+
private started(hall: Hall): void {
|
|
801
|
+
const game = hall.room.gameSettings
|
|
802
|
+
if (game?.notifyGameStarted !== true) return
|
|
803
|
+
|
|
804
|
+
const running = hall.room.userCount >= game.minPlayersToStartGame
|
|
805
|
+
if (hall.room.variables.get(Rooms.gameStarted)?.value === running) return
|
|
806
|
+
|
|
807
|
+
hall.room.variables.set(
|
|
808
|
+
Rooms.gameStarted,
|
|
809
|
+
RoomVariable.of(Rooms.gameStarted, running, true, true),
|
|
810
|
+
)
|
|
811
|
+
this.announce(hall, [
|
|
812
|
+
RoomVariable.of(Rooms.gameStarted, running, true, true),
|
|
813
|
+
])
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Removes a room made at runtime once its rule says so
|
|
818
|
+
* @param hall the room
|
|
819
|
+
*/
|
|
820
|
+
private reap(hall: Hall): void {
|
|
821
|
+
if (!hall.room.dynamic || hall.members.size > 0) return
|
|
822
|
+
|
|
823
|
+
const orphaned =
|
|
824
|
+
hall.creator === null || this.zone.named(hall.creator) === null
|
|
825
|
+
const due =
|
|
826
|
+
hall.autoRemove === AutoRemove.WHEN_EMPTY ||
|
|
827
|
+
(hall.autoRemove === AutoRemove.WHEN_EMPTY_AND_CREATOR_IS_GONE &&
|
|
828
|
+
orphaned) ||
|
|
829
|
+
(hall.autoRemove === AutoRemove.DEFAULT && (hall.room.game || orphaned))
|
|
830
|
+
|
|
831
|
+
if (due) this.remove(hall)
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* What's wrong with a room name, or null
|
|
836
|
+
* @param name the name a user picked
|
|
837
|
+
*/
|
|
838
|
+
private nameRefusal(name: string): SfsError | null {
|
|
839
|
+
if (
|
|
840
|
+
name.length < this.zone.minRoomNameLength ||
|
|
841
|
+
name.length > this.zone.maxRoomNameLength
|
|
842
|
+
) {
|
|
843
|
+
return this.zone.error(
|
|
844
|
+
ErrorCode.ROOM_NAME_BAD_SIZE,
|
|
845
|
+
this.zone.minRoomNameLength,
|
|
846
|
+
this.zone.maxRoomNameLength,
|
|
847
|
+
name.length,
|
|
848
|
+
)
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
const words = this.zone.words
|
|
852
|
+
if (words?.names === true && words.apply(name).found.length > 0) {
|
|
853
|
+
return this.zone.error(ErrorCode.ROOM_NAME_CONTAINS_BADWORDS, name)
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
if (this.zone.hallNamed(name) !== null) {
|
|
857
|
+
return this.zone.error(ErrorCode.ROOM_DUPLICATE_NAME, name)
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
return null
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Why a room can't be made, or null
|
|
865
|
+
* @param settings what the room should be like
|
|
866
|
+
* @param owner who asked for it, null for the server
|
|
867
|
+
*/
|
|
868
|
+
private creationRefusal(
|
|
869
|
+
settings: RoomSettings,
|
|
870
|
+
owner: Member | null,
|
|
871
|
+
): SfsError | null {
|
|
872
|
+
const error = this.nameRefusal(settings.name)
|
|
873
|
+
if (error !== null) return error
|
|
874
|
+
|
|
875
|
+
if (!this.zone.groups.has(settings.groupId)) {
|
|
876
|
+
return this.zone.error(
|
|
877
|
+
ErrorCode.CREATE_ROOM_BAD_GROUP,
|
|
878
|
+
settings.name,
|
|
879
|
+
settings.groupId,
|
|
880
|
+
)
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
if (this.zone.halls.size >= this.zone.maxRooms) {
|
|
884
|
+
return this.zone.error(ErrorCode.CREATE_ROOM_ZONE_FULL)
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
if (owner !== null && owner.created >= this.zone.maxRoomsPerUser) {
|
|
888
|
+
return this.zone.error(
|
|
889
|
+
ErrorCode.CREATE_ROOM_EXCEED_USER_LIMIT,
|
|
890
|
+
this.zone.maxRoomsPerUser,
|
|
891
|
+
)
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
if (!(settings.maxUsers > 0)) {
|
|
895
|
+
return this.zone.error(ErrorCode.CREATE_ROOM_WRONG_PARAMETER, 'maxUsers')
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
if (settings.maxSpectators < 0) {
|
|
899
|
+
return this.zone.error(
|
|
900
|
+
ErrorCode.CREATE_ROOM_WRONG_PARAMETER,
|
|
901
|
+
'maxSpectators',
|
|
902
|
+
)
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
const mmo = settings.mmo
|
|
906
|
+
if (
|
|
907
|
+
mmo !== null &&
|
|
908
|
+
(mmo.lowerLimit === null) !== (mmo.higherLimit === null)
|
|
909
|
+
) {
|
|
910
|
+
return this.zone.error(ErrorCode.CREATE_ROOM_WRONG_PARAMETER, 'mapLimits')
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const game = settings.game
|
|
914
|
+
if (game !== null && game.minPlayersToStartGame > settings.maxUsers) {
|
|
915
|
+
return this.zone.error(
|
|
916
|
+
ErrorCode.CREATE_ROOM_WRONG_PARAMETER,
|
|
917
|
+
'minPlayersToStartGame',
|
|
918
|
+
)
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
return null
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Why a user can't join a room, or null
|
|
926
|
+
* @param member who's joining
|
|
927
|
+
* @param hall the room
|
|
928
|
+
* @param options how the join differs from the plain case
|
|
929
|
+
* @param spectator whether they come to watch
|
|
930
|
+
* @param forced whether the password and access rules are skipped
|
|
931
|
+
*/
|
|
932
|
+
private joinRefusal(
|
|
933
|
+
member: Member,
|
|
934
|
+
hall: Hall,
|
|
935
|
+
options: JoinOptions,
|
|
936
|
+
spectator: boolean,
|
|
937
|
+
forced: boolean,
|
|
938
|
+
): SfsError | null {
|
|
939
|
+
if (hall.members.has(member.id)) {
|
|
940
|
+
return this.zone.error(ErrorCode.JOIN_ALREADY_JOINED, hall.name)
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
if (
|
|
944
|
+
!forced &&
|
|
945
|
+
hall.room.passwordProtected &&
|
|
946
|
+
(options.password ?? '') !== hall.room.password
|
|
947
|
+
) {
|
|
948
|
+
return this.zone.error(ErrorCode.JOIN_BAD_PASSWORD, hall.name)
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
if (!forced && !this.zone.games.admits(member, hall, spectator)) {
|
|
952
|
+
return this.zone.error(ErrorCode.JOIN_GAME_ACCESS_DENIED, hall.name)
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
if (
|
|
956
|
+
!hall.fits(spectator) ||
|
|
957
|
+
member.rooms.size >= this.zone.maxJoinedRooms
|
|
958
|
+
) {
|
|
959
|
+
return this.zone.error(ErrorCode.JOIN_ROOM_FULL, hall.name)
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
return null
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Why a user can't switch seats in a room, or null
|
|
967
|
+
* @param member who's switching
|
|
968
|
+
* @param hall the room
|
|
969
|
+
*/
|
|
970
|
+
private switchRefusal(member: Member, hall: Hall): SfsError | null {
|
|
971
|
+
if (!hall.room.game) {
|
|
972
|
+
return this.zone.error(ErrorCode.SWITCH_NOT_A_GAME_ROOM, hall.name)
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
if (!hall.members.has(member.id)) {
|
|
976
|
+
return this.zone.error(ErrorCode.SWITCH_NOT_JOINED_IN_ROOM, hall.name)
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
return null
|
|
980
|
+
}
|
|
981
|
+
}
|