diff options
Diffstat (limited to 'client/game.lua')
-rw-r--r-- | client/game.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/game.lua b/client/game.lua index 50b74f9..31e02b8 100644 --- a/client/game.lua +++ b/client/game.lua @@ -342,12 +342,16 @@ local function draw() end local connected = false +local sent_hshake = false function SCENE.update(dt) if connected then return update(dt) else handle_net() - if peer:state() == "connected" and local_player then + if peer:state() == "connected" and not sent_hshake then + peer:send(json.encode{t='handshake',username=username}) + sent_hshake = true + elseif peer:state() == "connected" and local_player then connected = true msgbox.add("connected to "..SERVER_HOSTNAME..":8473") msgbox.add("press F1 for controls help") @@ -363,7 +367,7 @@ function SCENE.draw() end end -function SCENE.load() +function SCENE.load(username) love.keyboard.setKeyRepeat(true) -- require"profile".start(10,io.open("./trace","w")) host = enet.host_create() |