Compare commits
4 Commits
d6015ef155
...
ae6e7171a8
Author | SHA1 | Date |
---|---|---|
Pascal Abresch | ae6e7171a8 | |
Pascal Abresch | eeb1756052 | |
Pascal Abresch | 5118472ef4 | |
Pascal Abresch | c513087c7a |
|
@ -35,9 +35,13 @@ end
|
||||||
|
|
||||||
commands.playerJoin = function(clientID, args)
|
commands.playerJoin = function(clientID, args)
|
||||||
local nickname, avatarEncoded = utils.nextStringRecord(args)
|
local nickname, avatarEncoded = utils.nextStringRecord(args)
|
||||||
avatar = love.data.decode("string", "base64", avatarEncoded)
|
avatarHash = love.data.decode("string", "base64", avatarEncoded)
|
||||||
ui.addChatEntry("", nickname .. " Joined the game")
|
ui.addChatEntry("", nickname .. " Joined the game")
|
||||||
players[clientID] = player.newPlayer({name = nickname, avatar = gameloop.avatars[avatar].image})
|
local avatar = { image = love.graphics.newImage("textures/player/nephele/fallback.png") }
|
||||||
|
if gameloop.avatars[avatarHash] then
|
||||||
|
avatar = gameloop.avatars[avatarHash]
|
||||||
|
end
|
||||||
|
players[clientID] = player.newPlayer({name = nickname, avatar = avatar.image})
|
||||||
players[clientID].label = love.graphics.newText(fonts.smallFont, nickname)
|
players[clientID].label = love.graphics.newText(fonts.smallFont, nickname)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -70,9 +74,13 @@ commands.chatMessage = function(clientID, args)
|
||||||
if clientID == "0" then
|
if clientID == "0" then
|
||||||
name = ""
|
name = ""
|
||||||
else
|
else
|
||||||
name = players[clientID].name
|
if players[clientID] and players[clientID].name then
|
||||||
|
name = players[clientID].name
|
||||||
|
else
|
||||||
|
name = "UNKNOWN?"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
ui.addChatEntry(players[clientID].name, args)
|
ui.addChatEntry(name, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
commands.deleteTexture = sharedCommands.deleteTexture
|
commands.deleteTexture = sharedCommands.deleteTexture
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 363 B |
Binary file not shown.
After Width: | Height: | Size: 235 B |
Binary file not shown.
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 401 B |
Binary file not shown.
After Width: | Height: | Size: 598 B |
Loading…
Reference in New Issue