mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-13 20:48:02 +01:00
fix to match format of empty return case
This commit is contained in:
parent
8ee17493ac
commit
d2897d6dc8
1 changed files with 6 additions and 4 deletions
|
@ -54,14 +54,16 @@ def query(req, ids, timeoutSecs = 5.0):
|
||||||
|
|
||||||
for id in ids: sock.send(id + '\n')
|
for id in ids: sock.send(id + '\n')
|
||||||
|
|
||||||
unpacker = struct.Struct('!2H') # 2s f')
|
shortUnpacker = struct.Struct('!H')
|
||||||
resLen, nameCount = unpacker.unpack(sock.recv(unpacker.size)) # problem when ids empty
|
resLen, = shortUnpacker.unpack(sock.recv(shortUnpacker.size))
|
||||||
|
nameCount, = shortUnpacker.unpack(sock.recv(shortUnpacker.size))
|
||||||
|
resLen -= shortUnpacker.size
|
||||||
print('resLen:', resLen, 'nameCount:', nameCount)
|
print('resLen:', resLen, 'nameCount:', nameCount)
|
||||||
msgsLists = {}
|
msgsLists = {}
|
||||||
if nameCount == len(ids):
|
if nameCount == len(ids) and resLen > 0:
|
||||||
|
print('nameCount', nameCount)
|
||||||
for ii in range(nameCount):
|
for ii in range(nameCount):
|
||||||
perGame = []
|
perGame = []
|
||||||
shortUnpacker = struct.Struct('!H')
|
|
||||||
countsThisGame, = shortUnpacker.unpack(sock.recv(shortUnpacker.size)) # problem
|
countsThisGame, = shortUnpacker.unpack(sock.recv(shortUnpacker.size)) # problem
|
||||||
print('countsThisGame:', countsThisGame)
|
print('countsThisGame:', countsThisGame)
|
||||||
for jj in range(countsThisGame):
|
for jj in range(countsThisGame):
|
||||||
|
|
Loading…
Add table
Reference in a new issue