Compare commits
No commits in common. "multithread" and "master" have entirely different histories.
multithrea
...
master
3 changed files with 0 additions and 57 deletions
|
@ -82,8 +82,6 @@ AddCSLuaFile("vgui/zshealtharea.lua")
|
|||
AddCSLuaFile("vgui/zsstatusarea.lua")
|
||||
AddCSLuaFile("vgui/zsgamestate.lua")
|
||||
|
||||
include("multithread.lua")
|
||||
|
||||
include("sh_globals.lua")
|
||||
|
||||
include("obj_entity_extend_sv.lua")
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
require("effil")
|
||||
|
||||
GM.MT = {}
|
||||
local m = GM.MT
|
||||
|
||||
local charset = {}
|
||||
|
||||
for i = 48, 57 do table.insert(charset, string.char(i)) end
|
||||
for i = 65, 90 do table.insert(charset, string.char(i)) end
|
||||
for i = 97, 122 do table.insert(charset, string.char(i)) end
|
||||
|
||||
function randStr(length)
|
||||
math.randomseed(os.time())
|
||||
|
||||
if length > 0 then
|
||||
return randomStr(length - 1) .. charset[math.random(1, #charset)]
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
function m:WaitForAll(threads)
|
||||
local results = {}
|
||||
for i=1, #threads do
|
||||
results[i] = threads[i]:get()
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
function m:MarkEntity(ent)
|
||||
if not ent or not ent:IsValid() then return nil end
|
||||
ent._MT_ID = ent._MT_ID or randStr(5)
|
||||
return {ent:GetClass(), ent._MT_ID}
|
||||
end
|
||||
|
||||
function m:FindEnt(id)
|
||||
if not id then return nil end
|
||||
for _,v in pairs(ents.FindByClass(id[1])) do
|
||||
if v._MT_ID == id[2] then return v end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
hook.Add("PlayerSpawn", "aa", function(ply)
|
||||
effil.thread(function()print("we are on the other thread")end)()
|
||||
local id = GAMEMODE.MT.MarkEntity(ply)
|
||||
PrintTable(id)
|
||||
print("main")
|
||||
--[[effil.thread(function(t)
|
||||
local p = GAMEMODE.MT.FindEnt(t)
|
||||
print("t p", p)
|
||||
end)]]
|
||||
end)
|
|
@ -1,7 +1,5 @@
|
|||
English | [中文(简体)](readme_zh-CN.md)
|
||||
|
||||
**WARNING: This edition of Zombie Survival requires extra library on server.**
|
||||
|
||||
# Zombie Survival
|
||||
The definitive zombie experience.
|
||||
A gamemode for Garry's Mod.
|
||||
|
|
Loading…
Reference in a new issue