Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaogaotiantian/colorfightiiserver
ColorfightII Server Side Code
https://github.com/gaogaotiantian/colorfightiiserver
Last synced: 26 days ago
JSON representation
ColorfightII Server Side Code
- Host: GitHub
- URL: https://github.com/gaogaotiantian/colorfightiiserver
- Owner: gaogaotiantian
- License: gpl-3.0
- Created: 2019-01-25T22:56:30.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:03:50.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T19:41:23.931Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 6.77 MB
- Stars: 4
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is the new version of ColorFight
The client should use ```WebSocket``` to communicate with the server.
Two ```WebSocket``` instances are used for the game.
## Game Channel
The first one is on ```game_channel```, which collects information from the
game. The client should keep this ws alive, this channel is read only, meaning
the client should wait for the server to publish data.### Data Format
Data is in json format.
TODO: detailed description.
## Action Channel
The second one is on ```action_channel```, which is used for clients to send
actions to the server.### Action Format
The client should send a ```string``` representing a json object.
```{'action': action, **kwargs}```
```action``` is a string representing the kind of action. It could be
* register
* {'action': 'register', 'username': username, 'password': password}
* command
* {'action': 'command', 'cmd_list': cmd_list}#### Command List
The client interacts with the server with command list. The command list should
be a list of commands in a single turn.A command is a string with arguments separated by spaces
ex ```a 2 3 200```
The first argument represents for the kind of command.
* ```'a'``` for Attack
* 'a x y energy'
* Attack ```(x, y)``` with ```energy```