-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b584b5
commit 355423c
Showing
76 changed files
with
1,166 additions
and
851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import addHandler from "#cmd/handlePacket"; | ||
|
||
// list of all the chats of this player | ||
addHandler('chats list', (c, data) => { | ||
c.sendChatsList(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
import { addHandler } from "#cmd/handlePacket"; | ||
import { clamp } from "#util/maths"; | ||
|
||
|
||
addHandler('player controls', (c, data) => { | ||
if (!c.entity) | ||
return; | ||
|
||
c.entity.inputs = { | ||
move: data.move, | ||
keys: { | ||
kright: data.kright, | ||
kleft: data.kleft, | ||
kup: data.kup, | ||
kdown: data.kdown, | ||
|
||
kjump: data.kjump, | ||
kjump_rel: data.kjump_rel, | ||
kjump_press: data.kjump_press | ||
} | ||
}; | ||
|
||
c.entity.inputs.move.x = clamp(c.entity.inputs.move.x, -1, 1); | ||
c.entity.inputs.move.y = clamp(c.entity.inputs.move.y, -1, 1); | ||
for (let input_name in c.entity.inputs) { | ||
if (data[input_name] !== undefined) | ||
c.entity.inputs[input_name] = data[input_name]; | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import SendStuff from "#cmd/sendStuff"; | ||
import { messageSerialize } from "#schemas/chat"; | ||
|
||
SendStuff.prototype.sendChatMessage = function (chat_id, message) { | ||
this.send({ cmd: 'chat msg', chat_id, message: messageSerialize(message) }); | ||
}; | ||
|
||
SendStuff.prototype.sendChatHistory = function (chat_id, messages) { | ||
// this.send({ cmd: 'chat history', chat_id, history: messages.map(m => ({ content: m.content, name: m.name, profile_id: null })) }); | ||
this.send({ cmd: 'chat history', chat_id, history: messages.map(messageSerialize) }); | ||
}; | ||
|
||
SendStuff.prototype.sendChatInfo = function (chat) { | ||
this.send({ cmd: 'chat info', chat: chat.serialize() }); | ||
}; | ||
|
||
SendStuff.prototype.sendChatsList = function () { | ||
this.send({ cmd: 'chats list', chats: this.chats.map(chat => chat.chat_id) }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.