Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HackaTron Wrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FOSS-AG
Events
HackaTRON
HackaTron Wrapper
Commits
cafeb182
Verified
Commit
cafeb182
authored
1 year ago
by
Jonas Zohren
Browse files
Options
Downloads
Patches
Plain Diff
Update errorcodes + protocol docs from hackatron server repo
parent
2b374998
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ERRORCODES.md
+25
-28
25 additions, 28 deletions
ERRORCODES.md
PROTOCOL.md
+24
-33
24 additions, 33 deletions
PROTOCOL.md
with
49 additions
and
61 deletions
ERRORCODES.md
+
25
−
28
View file @
cafeb182
...
...
@@ -3,62 +3,59 @@
Sometimes you will get error codes from the server.
Here is a small documentation of those error codes.
## ERROR_
SPAM
You
are spamming the server.
## ERROR_
RATELIMIT
You
sent to many packets per second.
## ERROR_PACKET_OVERFLOW
You
are sending more
than 1024 bytes
to the server
.
You
r packet was larger
than 1024 bytes.
## ERROR_NO_MOVE
You didnt send a move packet.
You didn
'
t send a move packet.
## ERROR_MAX_CONNECTIONS
Your ip is already connected.
IPv6 may workarounds this but please dont flood the server with connections :(
Your ip is already connected.
## ERROR_JOIN_TIMEOUT
You didnt send the join packet.
You didn
'
t send the join packet.
## ERROR_EXPECTED
_JOIN
Instead of join you sent some other packet
.
## ERROR_
JOIN_
EXPECTED
Your first packet was not a join
.
## ERROR_INVALID_USERNAME
You used an invalid username. (e.g. not a string)
## ERROR_USERNAME_INVALID
You used an invalid username.
## ERROR_USERNAME_FORBIDDEN
You used a forbidden username.
## ERROR_USERNAME_TOO_SHORT
Username is too short.
Your
Username is too short.
## ERROR_USERNAME_TOO_LONG
Username is too long.
## ERROR_USERNAME_INVALID_SYMBOLS
You used invalid symbols for the username.
Your Username is too long.
## ERROR_
INVALID_PASSWOR
D
You used an invalid password.
(e.g. not a string)
## ERROR_
PASSWORD_INVALI
D
You used an invalid password.
## ERROR_PASSWORD_TOO_SHORT
Password is too short.
Your
Password is too short.
## ERROR_PASSWORD_TOO_LONG
Password is too long.
Your
Password is too long.
## ERROR_NO_PERMISSION
You
should not do this :^) (e.g. hijack bots)
You
don't have permission to do this.
## ERROR_WRONG_PASSWORD
Your password
wa
s wrong.
Your password
i
s wrong.
## ERROR_ALREADY_CONNECTED
You are already connected with this player.
## ERROR_ILLEGAL_MOVE
You tried to do something illegal :O
## WARNING_UNKNOWN_MOVE
You did not send a valid move packet.
## ERROR_DEAD_CANNOT_CHAT
You are dead so shush :^)
## ERROR_INVALID_CHAT_MESSAGE
Something is wrong with your chat message.
## ERROR_UNKNOWN_PACKET
Server does not know what you want :D
You sent an unknown command.
This diff is collapsed.
Click to expand it.
PROTOCOL.md
+
24
−
33
View file @
cafeb182
# Protocol
The protocol is string based.
Every packet will end with a newline (
\n
), but the Hackathon wrapper handles them for you.
E.g:
`pos|10|50|5`
Every packet must and will end with a newline (
\n
).
E.g:
`pos|10|50|5\n`
**Note:**
_All next examples in this documentation are given without
\n
. But dont forget it in your parsing!_
## Packet structure
...
...
@@ -21,7 +22,6 @@ motd means "Message of the day".
**Name:**
motd
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|------------------------|
| 1 | String | The message of the day |
...
...
@@ -36,8 +36,7 @@ Remember the password otherwise you cant use the username again!
**Name:**
join
**Sender:**
Client
**Arguments:**
| # | Type | Description |
| # | Type | Description |
|---|--------|--------------|
| 1 | String | The username |
| 2 | String | The password |
...
...
@@ -51,9 +50,8 @@ The error packet is sent by the server if something went wrong.
**Name:**
error
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|-------------------------------------------------------|
| # | Type | Description |
|---|--------|--------------|
| 1 | String | The error according to
[
ERRORCODES.md
](
ERRORCODES.md
)
|
**Example:**
`error|INVALID_USERNAME`
...
...
@@ -66,12 +64,11 @@ It contains information about the map size and the current player id.
**Name:**
game
**Sender:**
Server
**Arguments:**
| # | Type | Description |
| # | Type | Description |
|---|--------|-------------------------------|
| 1 | Number | The width of the current map
|
| 1 | Number | The width of the current map |
| 2 | Number | The height of the current map |
| 3 | Number | The current player id
|
| 3 | Number | The current player id |
**Example:**
`game|100|100|5`
...
...
@@ -82,10 +79,9 @@ The pos packet is sent by the server to inform the client about a players curren
**Name:**
pos
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|--------------------------|
| 1 | Number | The player id |
| # | Type | Description |
|---|--------|--------------------------------------------------------------------|
| 1 | Number | The player id |
| 2 | Number | x position of the player |
| 3 | Number | y position of the player |
...
...
@@ -98,10 +94,9 @@ The player packet is sent by the server to share informations of an player.
**Name:**
player
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|------------------------|
| 1 | Number | The player id |
| # | Type | Description |
|---|--------|--------------------------------------------------------------------|
| 1 | Number | The player id |
| 2 | String | The name of the player |
**Example:**
`player|3|Coolguy`
...
...
@@ -123,9 +118,8 @@ The die packet is sent by the server to inform the client about a players who di
**Name:**
die
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|------|--------|---------------|
| # | Type | Description |
|---|--------|--------------------------------------------------------------------|
| 1... | Number | The player id |
**Example (1 dead player):**
`die|5`
...
...
@@ -138,8 +132,7 @@ The move packet is sent by the client to decide where to move.
**Name:**
move
**Sender:**
Client
**Arguments:**
| # | Type | Description |
| # | Type | Description |
|---|--------|-------------------------|
| 1 | String | up, right, down or left |
...
...
@@ -152,10 +145,9 @@ The win packet is sent by the server to inform the client they won.
**Name:**
win
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|------------------|
| 1 | Number | amount of wins |
| # | Type | Description |
|---|--------|-----------------|
| 1 | Number | amount of wins |
| 2 | Number | amount of losses |
**Example:**
`win|1|20`
...
...
@@ -167,10 +159,9 @@ The lose packet is sent by the server to inform the client they lost.
**Name:**
lose
**Sender:**
Server
**Arguments:**
| # | Type | Description |
|---|--------|------------------|
| 1 | Number | amount of wins |
| # | Type | Description |
|---|--------|-----------------|
| 1 | Number | amount of wins |
| 2 | Number | amount of losses |
**Example:**
`lose|1|20`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment