-
Notifications
You must be signed in to change notification settings - Fork 0
Game
黃健旻 edited this page Jan 31, 2019
·
2 revisions
class RoomIdName {
id: String,
name: String,
}
class MemberInfo {
account: String,
character: String,
status: String,
}
class Protocol {
roomId: String,
name: String,
type: String,
rooms: List<RoomIdName>,
membersInfo: List<MemberInfo>,
killWho: String,
beatWho: String,
from: String,
msg: String,
isPublic: Boolean
}
- send
socket.emit('Game', JSON.stringify({"type": "CreateRoom", "name": "Room 123", "isPublic": true}), function (acknowledgement) { ... });
- listen
socket.on('Game', function (msg: ProtocolMsg) {
...
});
- send
socket.emit('Game', JSON.stringify({"roomId":"RFCVG-FGBJM-VGHBJM-SRTGBI", "type": "RequestSwitchDay"}), function (acknowledgement) { ... });
- listen
socket.on('Game', function (msg: ProtocolMsg) {
...
});
- send
socket.emit('Game', JSON.stringify({"roomId":"RFCVG-FGBJM-VGHBJM-SRTGBI", "type": "RequestSwitchNight"}), function (acknowledgement) { ... });
- listen
socket.on('Game', function (msg: ProtocolMsg) {
...
});
- send
socket.emit('Game', JSON.stringify({"roomId":"RFCVG-FGBJM-VGHBJM-SRTGBI", "type": "RequestKill", "killWho": "Vincent"}), function (acknowledgement) { ... });
- listen
socket.on('Game', function (msg: ProtocolMsg) {
...
});
- send
socket.emit('Game', JSON.stringify({"roomId":"RFCVG-FGBJM-VGHBJM-SRTGBI", "type": "RequestBeat", "beatWho": "Vincent"}), function (acknowledgement) { ... });
- listen
socket.on('Game', function (msg: ProtocolMsg) {
...
});
Copyright (c) 2019 CommonMarvel