From 91769984fb38b5f020f4e7915110300b47fc240d Mon Sep 17 00:00:00 2001 From: imezx Date: Wed, 6 Sep 2023 15:44:37 +0700 Subject: [PATCH] re-update rc9 0.9.2 --- FastNet2_Rewrite.rbxm | Bin 11016 -> 11062 bytes src/Client/Process.luau | 2 +- src/Client/init.luau | 12 ++++++------ src/Debug.luau | 11 +++++++---- src/Server/init.luau | 14 +++++++------- src/init.luau | 2 +- src/oneSignal.luau | 12 ++++++------ 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/FastNet2_Rewrite.rbxm b/FastNet2_Rewrite.rbxm index aa16dd1e94c08fcaceb9788420ced96de28c3e7c..bb46aa4b0d4241c4e35a6c16164399ef5cf10c9e 100644 GIT binary patch delta 8214 zcmXYWd0pS2?P-b z0i|v%rndG|M8RsU3s|gmx3*R5Qnj_#wtlVFg;v{YwOT8m)$j28egDkdd+xd0x$pbD z&-1+BSo`4G6VGz}!CGL_=-4lK2|aT1J^n*hu$|r!*IBvz>?O<3cUHMQBiVF*dt)@= zw4_M;2LGBRoUGg9rnkCnPG)4V+s)?4j^>AIa9+%|EbCo-Y_%BCmrIL6E!Xa@0)$#a)Fb~1{2z)O)n9eyP!^!+m^1BRw zhuJPVZEJ4UeVlcsoHd#BO>j~JHs)Wfmd3*iPHfGZMf2kKGn*Cwb*PTTU+3D*Kt!{m z@GRg(EA#B*Gv^FAed?t$Zobv&E!?a14-EC^Y^zV88Z;i0`qP;T$c5abddyj(j?L%1 zp4d{(duejVz`y}aPWL$%a_$J;f?YW`Kj`LD`Ja(?6``J6^L1ROx4PN*CX#I^yLIkB zTCHn5Zty1zx`h2pTQ!{8mT_vG`B~Q;J8YVP-x-`6ycFy@gNGr?#(ro{r!`|AnbCPE zEnIa77teB{NZtYy?QcDq$I?p3|H&58Mti#y3#PAvWqQ4#2{7<GlN3`cn zvE4X3mU4PZEcTF5=?oq+0`W=~j(t;S2X*5LU0Z-Vnz{#ux>b~y(gwDs>=+BKj)Gm<7-yr{LrZEGc{0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(^6u9jIVQKuUwkUClk5qPW2Di7J`L?trsXmdAgGM zi2(TZN^lNW>Q9v_&z~h%OPLnz-zDo?*XPFi!wK|t%}S&bZ=Jnpmg<3qot1dM!5iDv z=nE-B>}=(=)9Wh67LKYWQ9=2xgZ7^;#?Qd&SC$Nn%y!-kx~dIIX3j>Pz2nhDy}jeg zd?2EF7k?rCGQ&hr9TV>li~VX+87aF<5vv*GU8xA#D#4m2V+ZI_hR5Jp{9tG8aONK_ zpE&`g-4~#yqeo?8LxYd(i$uTjsaZgYoM(d zuY!Xv5DINsN%v1wyJha84GBA$SIxPf#%Y{#Syq65$S?;1YZ%J!lFLBsdntW-2wr0M ts7`NCtE}P5=Y9yJ ()) - Debug.new(not self.Connected, string.format("[FastNet2]: %s already connected", self.Identifier)) + Debug.new(not self.Connected, string.format("[FastNet2]: %s already connected", self.Identifier), 0) self.func = callback Process.reg_pre_f(self.Identifier, callback) self.Connected = true @@ -140,9 +140,9 @@ end **--]] function Client:Pull(timeout: number, ...: any) - Debug.new(typeof(timeout) == "number", "[FastNet2]: expire argument must be a number.") - Debug.new(timeout > 1, "[FastNet2]: expire argument must be minimum 2.") - Debug.new(#{...} > 0, "[FastNet2]: Unable to invoke without data") + Debug.new(typeof(timeout) == "number", "[FastNet2]: expire argument must be a number.", 0) + Debug.new(timeout > 1, "[FastNet2]: expire argument must be minimum 2.", 0) + Debug.new(#{...} > 0, "[FastNet2]: Unable to invoke without data", 0) local thread, requestId = coroutine.running(), tostring(#self.flag + 1) local session = task.delay(timeout, function() -- session expire diff --git a/src/Debug.luau b/src/Debug.luau index 3c549cf..ec4e975 100644 --- a/src/Debug.luau +++ b/src/Debug.luau @@ -1,12 +1,15 @@ --!strict local Debug = {} - local Logs = {} -function Debug.new(condition: any, message: string): boolean - table.insert(Logs, message.." ("..((condition) == true and "PASS" or "ERR")..")") - if not (condition) then error(message, 2) end +function Debug.new(condition: any, message: string, safe: number): boolean + if safe == 1 then + if not (condition) then warn(message) end + else + table.insert(Logs, message.." ("..((condition) == true and "PASS" or "ERR")..")") + if not (condition) then error(message, 2) end + end return (condition) end diff --git a/src/Server/init.luau b/src/Server/init.luau index 402a42b..5cd77e5 100644 --- a/src/Server/init.luau +++ b/src/Server/init.luau @@ -21,8 +21,8 @@ local Collections = {} **--]] function Server.new(Identifier: string) - Debug.new(typeof(Identifier) == "string", "[FastNet2]: Identifier must be string") - Debug.new(not Identifiers.find(Util.hash(Identifier)), string.format("[FastNet2]: %s already exist", Identifier)) + Debug.new(typeof(Identifier) == "string", "[FastNet2]: Identifier must be string", 0) + Debug.new(not Identifiers.find(Util.hash(Identifier)), string.format("[FastNet2]: %s already exist", Identifier), 0) Process.reg(Util.hash(Identifier)) Collections[Util.hash(Identifier)] = setmetatable({ Identifier = Util.hash(Identifier), @@ -40,7 +40,7 @@ end **--]] function Server:Connect(callback: (...any) -> ()) - Debug.new(not self.Connected, string.format("[FastNet2]: %s already connected", self.Identifier)) + Debug.new(not self.Connected, string.format("[FastNet2]: %s already connected", self.Identifier), 0) self.func = callback Process.reg_pre_f(self.Identifier, callback) self.Connected = true @@ -145,10 +145,10 @@ end **--]] function Server:Pull(timeout: number, player: Player, ...: any) - Debug.new(typeof(timeout) == "number", "[FastNet2]: expire argument must be a number.") - Debug.new(timeout > 1, "[FastNet2]: expire argument must be minimum 2.") - Debug.new(player:IsA("Player"), "[FastNet2]: player argument must be a Player.") - Debug.new(#{...} > 0, "[FastNet2]: Unable to invoke without data") + Debug.new(typeof(timeout) == "number", "[FastNet2]: expire argument must be a number.", 0) + Debug.new(timeout > 1, "[FastNet2]: expire argument must be minimum 2.", 0) + Debug.new(player:IsA("Player"), "[FastNet2]: player argument must be a Player.", 0) + Debug.new(#{...} > 0, "[FastNet2]: Unable to invoke without data", 0) local thread, requestId = coroutine.running(), tostring(#self.flag + 1) local session = task.delay(timeout, function() -- session expire diff --git a/src/init.luau b/src/init.luau index 2389f3b..166f920 100644 --- a/src/init.luau +++ b/src/init.luau @@ -43,7 +43,7 @@ end **--]] function FastNet2.CheckUpdate() - Debug.new(IsServer, "[FastNet2]: Unable to check update due ROBLOX Security.") + Debug.new(IsServer, "[FastNet2]: Unable to check update due ROBLOX Security.", 1) local success: boolean, receive: number = pcall(function() return tonumber( HttpService:GetAsync("https://raw.githubusercontent.com/imezx/FastNet2/master/VERSION", true) diff --git a/src/oneSignal.luau b/src/oneSignal.luau index fef5e88..9c5a5cd 100644 --- a/src/oneSignal.luau +++ b/src/oneSignal.luau @@ -12,8 +12,8 @@ local Collections = {} local Debug = require(script.Parent.Debug) function oneSignal.new(identifier: string) - Debug.new(typeof(identifier) == "string", "[oneSignal]: Identifier must be string") - Debug.new(not Collections[identifier], string.format("[oneSignal]: %s already exist", identifier)) + Debug.new(typeof(identifier) == "string", "[oneSignal]: Identifier must be string", 0) + Debug.new(not Collections[identifier], string.format("[oneSignal]: %s already exist", identifier), 0) Collections[identifier] = setmetatable({ cb = nil, Connected = false, @@ -25,13 +25,13 @@ function oneSignal.new(identifier: string) end function oneSignal.get(identifier: string) - Debug.new(Collections[identifier], string.format("[oneSignal]: %s not exist", identifier)) + Debug.new(Collections[identifier], string.format("[oneSignal]: %s not exist", identifier), 0) return Collections[identifier] end function oneSignal:Connect(callback: (...any) -> ()) if self then - Debug.new(not self.Connected, string.format("[oneSignal]: %s already connected", self.Identifier)) + Debug.new(not self.Connected, string.format("[oneSignal]: %s already connected", self.Identifier), 0) self.cb = callback self.Connected = true end @@ -39,8 +39,8 @@ end function oneSignal:Invoke(timeout: number, ...: any): any if self then - Debug.new(typeof(timeout) == "number", string.format("[oneSignal]: timeout must be number, got %s", typeof(timeout))) - Debug.new(#{...} > 0, "[oneSignal]: Unable to invoke without data") + Debug.new(typeof(timeout) == "number", string.format("[oneSignal]: timeout must be number, got %s", typeof(timeout)), 0) + Debug.new(#{...} > 0, "[oneSignal]: Unable to invoke without data", 0) timeout = math.max(1, timeout) local thread, packed, retrive = coroutine.running(), { ... }, nil local session = task.delay(timeout, function()