diff --git a/extra/uuid.lua b/extra/uuid.lua index 48a16b2..29a52ad 100644 --- a/extra/uuid.lua +++ b/extra/uuid.lua @@ -195,7 +195,7 @@ end -- uuid.seed() -- print("here's a new uuid: ",uuid()) function M.seed() - if package.loaded["socket"] and package.loaded["socket"].gettime then + if package.loaded["sockdl"] and package.loaded["sockdl"].gettime then return M.randomseed(package.loaded["socket"].gettime()*10000) else return M.randomseed(os.time()) diff --git a/src/bzpre/bzext.moon b/src/bzpre/bzext.moon index 590f0c5..674c0c5 100644 --- a/src/bzpre/bzext.moon +++ b/src/bzpre/bzext.moon @@ -51,13 +51,13 @@ craftStates = { } -getAppInfo = (id) -> +getAppInfo = (id="301650") -> if not _appinfo _appinfo = bzpre.getAppInfo(id) return _appinfo -getUserId = () -> - getAppInfo()\gmatch('"LastOwner"%s*"(%d+)"')() +getUserId = (id) -> + getAppInfo(id)\gmatch('"LastOwner"%s*"(%d+)"')() -- producer specific functions diff --git a/src/bzpre/bztt.moon b/src/bzpre/bztt.moon index 5a77ba1..e7124be 100644 --- a/src/bzpre/bztt.moon +++ b/src/bzpre/bztt.moon @@ -147,12 +147,13 @@ class ReadBuffer class TcpSocket new: (sock=socket.tcp(), timeout=0.005) => @sock = sock - @sock\settimeout(timeout) + @timeoutValue = 0 + @settimeout(timeout) @mode = "NONE" @socketSubject = Subject.create() @closed = false @sock\setoption("keepalive", true) - + @connect: (...) => sock = socket.tcp() res, err = sock\connect(...) @@ -167,6 +168,13 @@ class TcpSocket return nil return TcpSocket(sock) + settimeout: (v) => + @sock\settimeout(v) + @timeoutValue = v + + gettimeout: () => + return @timeoutValue + getstats: () => return @sock\getstats() diff --git a/src/ecs/bzcomp.moon b/src/ecs/bzcomp.moon index ab24917..212f2d3 100644 --- a/src/ecs/bzcomp.moon +++ b/src/ecs/bzcomp.moon @@ -80,42 +80,7 @@ class ParticleEmitterComponent extends Component -namespace("ecs.component", - BzHandleComponent, - BzBuildingComponent, - BzVehicleComponent, - BzPlayerComponent, - BzPersonComponent, - BzRecyclerComponent, - BzFactoryComponent, - BzArmoryComponent, - BzHowitzerComponent, - BzWalkerComponent, - BzConstructorComponent, - BzWingmanComponent, - BzGuntowerComponent, - BzTurretComponent, - BzScavengerComponent, - BzTugComponent, - BzMinelayerComponent, - BzHangarComponent, - BzSupplydepotComponent, - BzSiloComponent, - BzCommtowerComponent, - BzPortalComponent, - BzPowerplantComponent, - BzSignComponent, - BzArtifactComponent, - BzStructureComponent, - BzAnimstructureComponent, - BzBarracksComponent, - ParticleEmitterComponent, - BzLocalComponent, - BzRemoteComponent -) - - -return { +components = { :BzHandleComponent, :BzBuildingComponent, :BzVehicleComponent, @@ -150,3 +115,8 @@ return { :BzRemoteComponent, :PositionComponent } + +for i, v in pairs(components) + namespace("ecs.component", v) + +return components diff --git a/src/math/exmath.moon b/src/math/exmath.moon index b4f51b5..d7043ae 100644 --- a/src/math/exmath.moon +++ b/src/math/exmath.moon @@ -141,7 +141,7 @@ class Area @path = path @handles = {} @enabled = false - --Calculate center and radius + --Calculate center and radius @_bounding() --register everyone that is inside