diff options
author | ubq323 <ubq323@ubq323.website> | 2023-06-18 03:31:03 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-06-18 03:31:03 +0100 |
commit | 1490cf19a950d99b045fe68d7151a6cd54c57e27 (patch) | |
tree | c05a14cd80f8ff2623da0e47cc274ba85b6d96d1 /server/player.lua | |
parent | d5e264125994b6e5943ffb42f607362b3e79bcba (diff) |
add handshaking system, and refactor server a bit
Diffstat (limited to 'server/player.lua')
-rw-r--r-- | server/player.lua | 6 |
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 |