makes tests green
This commit is contained in:
parent
46f1f41cc9
commit
0d4e52c648
10 changed files with 36 additions and 32 deletions
|
|
@ -277,7 +277,7 @@ when isMainModule:
|
|||
s.flush
|
||||
|
||||
defPacket(Y, tuple[z: int8])
|
||||
proc `$`(z: Y): string = result = "Y("& $z.z &")"
|
||||
proc `$`(z: Y): string = result = "Y(" & $z.z & ")"
|
||||
defPacket(TestPkt, tuple[x: seq[Y]])
|
||||
var test = newTestPkt()
|
||||
test.x.add([newY(5), newY(4), newY(3), newY(2), newY(1)])
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ proc handlePackets*(server: PServer; buf: PBuffer) =
|
|||
proc updateFileProgress*() =
|
||||
let progress = currentFileTransfer.pos / currentFileTransfer.fullLen
|
||||
downloadProgress.bg.setSize(vec2f(progress * 100, 20))
|
||||
downloadProgress.setString($currentFileTransfer.pos &'/'& $currentFileTransfer.fullLen)
|
||||
downloadProgress.setString($currentFileTransfer.pos & '/' & $currentFileTransfer.fullLen)
|
||||
|
||||
## HFileTransfer
|
||||
proc handleFilePartRecv*(serv: PServer; buffer: PBuffer) {.procvar.} =
|
||||
|
|
|
|||
|
|
@ -573,13 +573,13 @@ proc importItem(data: PJsonNode; errors: var seq[string]): PItemRecord =
|
|||
elif data[2]["bullet"].kind == JObject:
|
||||
result.bullet = importBullet(data[2]["bullet"], errors)
|
||||
else:
|
||||
errors.add "UNKNOWN BULLET TYPE for item "& result.name
|
||||
errors.add "UNKNOWN BULLET TYPE for item " & result.name
|
||||
of "ammo":
|
||||
result.kind = Ammo
|
||||
of "utility":
|
||||
nil
|
||||
else:
|
||||
errors.add "Invalid item type \""& data[1].str &"\" for item "& result.name
|
||||
errors.add "Invalid item type \""&data[1].str&"\" for item "&result.name
|
||||
|
||||
proc importBullet(data: PJsonNode; errors: var seq[string]): PBulletRecord =
|
||||
new(result)
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ task "download", "download game assets":
|
|||
|
||||
task "zip-lib", "zip up the libs dir":
|
||||
var z: TZipArchive
|
||||
if not z.open("libs-"& getDateStr() &".zip", fmReadWrite):
|
||||
if not z.open("libs-" & getDateStr() & ".zip", fmReadWrite):
|
||||
quit "Could not open zip"
|
||||
for file in walkDirRec("libs", {pcFile, pcDir}):
|
||||
echo "adding file ", file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue