local loveEncode,loveDecode=love.data.encode,love.data.decode local rem=table.remove local WS,TIME=WS,TIME local yield=YIELD local NET={ allow_online=false, accessToken=false, cloudData={}, roomState={--A copy of room structure on server roomInfo={ name=false, type=false, version=false, }, roomData={}, count=false, capacity=false, private=false, start=false, }, spectate=false,--If player is spectating specSRID=false,--Cached SRID when enter playing room, for connect WS after scene swapped seed=false, roomReadyState=false, UserCount="_", PlayCount="_", StreamCount="_", } local mesType={ Connect=true, Self=true, Broadcast=true, Private=true, Server=true, } --Lock & Unlock submodule local locks do local rawset=rawset locks=setmetatable({},{ __index=function(self,k)rawset(self,k,-1e99)return -1e99 end, __newindex=function(self,k)rawset(self,k,-1e99)end, }) end function NET.lock(name,T) if TIME()>=locks[name]then locks[name]=TIME()+(T or 1e99) return true else return false end end function NET.unlock(name) locks[name]=-1e99 end function NET.getlock(name) return TIME()=res.lowest then NET.allow_online=true if USER.authToken then NET.wsconn_user_token(USER.uid,USER.authToken) elseif SCN.cur=='main'then SCN.go('login') end end if VERSION.code