Skip to content

Commit

Permalink
Fix extension_tool: lunar_log.lua & cocos_cp_class.lua bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jie-meng committed Aug 19, 2017
1 parent 6d21fa6 commit ca7cb16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions publish/extension_tools/cocos_cp_class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local tb = util.strSplit(dst, ",")
for _, v in ipairs(tb) do
v = util.strTrim(v)
local v_class = util.fileBaseName(v)
util.writeTextFile(v, strReplaceAll(util.readTextFile(src), src_class, v_class))
util.writeTextFile(v, util.strReplaceAll(util.readTextFile(src), src_class, v_class))

print(string.format([[Cocos copy class "%s" to "%s" in path <%s> ok.]], src_class, v_class, util.currentPath()))
end
end
13 changes: 7 additions & 6 deletions publish/extension_tools/lunar_log.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
local ds = net.udpCreate(1)
local ds = util.newUdpSocket(1)

local port = 9966
if net.udpBind(ds, "", port) then
if ds:bind("", port) then
print(string.format("Recv log on port %d start:\n", port))
while true do
local len = net.udpRecvFrom(ds)
local len = ds:recvFrom()
if len > 0 then
print(memory.tostring(net.udpGetRecvBuf(ds)))
print(util.memToString(ds:getRecvBuf(ds)))
else
break
end
end
end

net.udpDestroy(ds)
ds:close()
ds:delete()

print(string.format("Recv log on port %d end.", port))
print(string.format("Recv log on port %d end.", port))

0 comments on commit ca7cb16

Please sign in to comment.