summaryrefslogtreecommitdiff
path: root/server/player.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-06-18 03:31:03 +0100
committerubq323 <ubq323@ubq323.website>2023-06-18 03:31:03 +0100
commit1490cf19a950d99b045fe68d7151a6cd54c57e27 (patch)
treec05a14cd80f8ff2623da0e47cc274ba85b6d96d1 /server/player.lua
parentd5e264125994b6e5943ffb42f607362b3e79bcba (diff)
add handshaking system, and refactor server a bit
Diffstat (limited to 'server/player.lua')
-rw-r--r--server/player.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/player.lua b/server/player.lua
index 365eadc..bd7b52a 100644
--- a/server/player.lua
+++ b/server/player.lua
@@ -8,23 +8,25 @@ local function random_color()
end
local Player = class()
-function Player.make(cls,peer)
+function Player.make(cls,peer,username)
local self = {
pos = Pos:make(0,0),
color = random_color(),
peer = peer,
id = nextid,
+ username = username,
}
nextid = nextid + 1
return setmetatable(self,cls)
end
function Player.info_part(self)
- -- eh
+ -- eh
return {
id=self.id,
x=self.pos.x,
y=self.pos.y,
color=self.color,
+ username=self.username,
}
end