Cant connect to room (corona sdk)

0 votes

I couldnt get Color Move sample to work and my own game has the same problem. Is there something wrong with the servers or api ?

This were my steps:

in main:
 
appWarpClient = require "AppWarp.WarpClient"
API_KEY = "API"
SECRET_KEY = "Secret"
STATIC_ROOM_ID = "ROOMID" (made a room and pasted the ID in here)
 
require "warplisteners"
 
in game
 
        appWarpClient.initialize(API_KEY, SECRET_KEY)
        appWarpClient.connectWithUserName(tostring(os.clock()))
 
 
in warplisteners
 
function onJoinRoomDone(resultCode,roomid)
    print(resultCode)
end
 
function onSubscribeRoomDone(resultCode)
  if(resultCode == WarpResponseResultCode.SUCCESS) then    
    print( "Started!")
  else
    print( "Room Subscribe Failed")
  end  
end
 
function onConnectDone(resultCode)
    appWarpClient.joinRoom(ROOMID)
 
end
 
function onUpdatePeersReceived(update)
print('something moved')
end
 
appWarpClient.addRequestListener("onConnectDone", onConnectDone)
appWarpClient.addRequestListener("onJoinRoomDone", onJoinRoomDone)
appWarpClient.addRequestListener("onSubscribeRoomDone", onSubscribeRoomDone)
appWarpClient.addNotificationListener("onUpdatePeersReceived", onUpdatePeersReceived)

 

 

onJoinRoomDone This one never gets called!! why ?! I tried this for hours its very frustrating because even the demo doesnt work. Am i doing something wrong ?

asked Apr 20, 2014 in AppWarp by gamekings (10 points)
recategorized Oct 26, 2014 by sushil

1 Answer

0 votes

Is onConnectDone being called? What is the result code in that?

answered Apr 20, 2014 by dhruvc (1,099 points)
Its called yes...result code is 0
ok so thats fine till there. can you uncomment the enableTrace statement in line 17 of file main.lua in the sample?

https://github.com/shephertz/AppWarpLua/blob/master/Samples/ColorMove/main.lua

This will cause the SDK to print some additional debug logs to the console.
2014-04-20 20:21:11.951 Corona Simulator[487:507] 1.163718 : lookup connected
2014-04-20 20:21:11.951 Corona Simulator[487:507] 1.164118 : sent lookup request
2014-04-20 20:21:12.380 Corona Simulator[487:507] 1.19371 : server address is 54.246.103.117
2014-04-20 20:21:12.380 Corona Simulator[487:507] 1.194143 : closed lookup socket
2014-04-20 20:21:12.446 Corona Simulator[487:507] 1.198284 : channel connected
2014-04-20 20:21:12.578 Corona Simulator[487:507] 1.254359 : read some partial bytes 34
2014-04-20 20:21:12.578 Corona Simulator[487:507] 1.254813 : decodeWarpResponseMessage buffer length: 34
2014-04-20 20:21:12.578 Corona Simulator[487:507] 1.255173 : messageType 1
2014-04-20 20:21:12.579 Corona Simulator[487:507] 1.255525 : requestType 1
2014-04-20 20:21:12.579 Corona Simulator[487:507] 1.25587 : resultCode 0
2014-04-20 20:21:12.579 Corona Simulator[487:507] 1.256173 : reserved 0
2014-04-20 20:21:12.580 Corona Simulator[487:507] 1.256459 : payloadType 2
2014-04-20 20:21:12.580 Corona Simulator[487:507] 1.256745 : payloadSize 25
2014-04-20 20:21:12.580 Corona Simulator[487:507] 1.257041 : payLoad {"sessionid":"617851543"}
2014-04-20 20:21:12.581 Corona Simulator[487:507] 1.257351 : WarpClient.joinRoom
2014-04-20 20:21:15.086 Corona Simulator[487:507] 1.29234 : read some partial bytes 9
2014-04-20 20:21:15.086 Corona Simulator[487:507] 1.292685 : decodeWarpResponseMessage buffer length: 9
2014-04-20 20:21:15.086 Corona Simulator[487:507] 1.292926 : messageType 1
2014-04-20 20:21:15.086 Corona Simulator[487:507] 1.293153 : requestType 63
2014-04-20 20:21:15.087 Corona Simulator[487:507] 1.293403 : resultCode 0
2014-04-20 20:21:15.087 Corona Simulator[487:507] 1.293644 : reserved 0
2014-04-20 20:21:15.087 Corona Simulator[487:507] 1.29387 : payloadType 0
2014-04-20 20:21:15.087 Corona Simulator[487:507] 1.294092 : payloadSize 0
2014-04-20 20:21:15.088 Corona Simulator[487:507] 1.294316 : payLoad
2014-04-20 20:21:18.088 Corona Simulator[487:507] 1.315861 : read some partial bytes 9
2014-04-20 20:21:18.089 Corona Simulator[487:507] 1.316315 : decodeWarpResponseMessage buffer length: 9
2014-04-20 20:21:18.089 Corona Simulator[487:507] 1.316675 : messageType 1
2014-04-20 20:21:18.090 Corona Simulator[487:507] 1.31701 : requestType 63
2014-04-20 20:21:18.090 Corona Simulator[487:507] 1.317347 : resultCode 0
2014-04-20 20:21:18.090 Corona Simulator[487:507] 1.31766 : reserved 0
2014-04-20 20:21:18.090 Corona Simulator[487:507] 1.317945 : payloadType 0
2014-04-20 20:21:18.091 Corona Simulator[487:507] 1.318229 : payloadSize 0
2014-04-20 20:21:18.091 Corona Simulator[487:507] 1.318517 : payLoad
2014-04-20 20:21:21.091 Corona Simulator[487:507] 1.343173 : read some partial bytes 9

it goes on and on and then after some time you get this:

2014-04-20 20:21:57.093 Corona Simulator[487:507] 1.711663 : decodeWarpResponseMessage buffer length: 9
2014-04-20 20:21:57.093 Corona Simulator[487:507] 1.712032 : messageType 1
2014-04-20 20:21:57.093 Corona Simulator[487:507] 1.712372 : requestType 63
2014-04-20 20:21:57.094 Corona Simulator[487:507] 1.712711 : resultCode 0
2014-04-20 20:21:57.094 Corona Simulator[487:507] 1.713023 : reserved 0
2014-04-20 20:21:57.094 Corona Simulator[487:507] 1.713309 : payloadType 0
2014-04-20 20:21:57.095 Corona Simulator[487:507] 1.713595 : payloadSize 0
2014-04-20 20:21:57.095 Corona Simulator[487:507] 1.71389 : payLoad
2014-04-20 20:22:07.784 Corona Simulator[487:507] 1.718689 : closed socket
There appears to be an issue here. I've updated the samples on our git repo as well as fixed a minor issue in the SDK which was causing this. Please clone from our git repo
https://github.com/shephertz/AppWarpLua/tree/master/V_1.6.1
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...