<commit_before># Golem Stone: Ant Attack
[![Build Status](https://travis-ci.org/Fleischers/GolemStoneAntAttack_server.svg)](https://travis-ci.org/Fleischers/GolemStoneAntAttack_server)
[![dependencies](https://david-dm.org/Fleischers/GolemStoneAntAttack_server.svg)](https://david-dm.org/Fleischers/GolemStoneAntAttack_server)

This repository stands for game server written in Node.js.  
You can review Unreal Engine 4 client code in the following repository: https://github.com/Feliss/GolemStoneAntAttack_client

## Installation and setup

To install and launch server:

`npm install`  
`npm start`

It will then listen for incoming socket messages.

## Connection
You can connect to server published on Heroku VM: http://antattack.herokuapp.com/

## API

### Client to server:

```
CONNECT|NICKNAME~
LOCATION|X|Y|Z~
MOVE|X|Y|Z|SPEED|ACCELERATION~
STOP|X|Y|Z~
PICK~
THROW|X|Y|Z|SPEED|ACCELERATION~
HIT|PLAYER_ID~
DEATH~
DISCONNECT~
```

### Server to client:

```
CONNECTED|PLAYER_ID~
PLAYER_ID|CONNECTED|NICKNAME~
PLAYER_ID|LOCATION|X|Y|Z~
PLAYER_ID|MOVE|X|Y|Z|SPEED|ACCELERATION~
PLAYER_ID|STOP|X|Y|Z~
PLAYER_ID|PICK~
PLAYER_ID|THROW|X|Y|Z|SPEED|ACCELERATION~
PLAYER_ID|HIT~
PLAYER_ID|DEATH~
PLAYER_ID|REVIVE~
PLAYER_ID|DISCONNECT~
```<commit_msg>Update readme with ROTATION and small description about variable types<commit_after># Golem Stone: Ant Attack
[![Build Status](https://travis-ci.org/Fleischers/GolemStoneAntAttack_server.svg)](https://travis-ci.org/Fleischers/GolemStoneAntAttack_server)
[![dependencies](https://david-dm.org/Fleischers/GolemStoneAntAttack_server.svg)](https://david-dm.org/Fleischers/GolemStoneAntAttack_server)

This repository stands for game server written in Node.js.  
You can review Unreal Engine 4 client code in the following repository: https://github.com/Feliss/GolemStoneAntAttack_client

## Installation and setup

To install and launch server:

`npm install`  
`npm start`

It will then listen for incoming socket messages.

## Connection
You can connect to server published on Heroku VM: http://antattack.herokuapp.com/

## API
**Notes on variable types:**

**x, y, z,** *{double}* - static coordinates  
**vecX, vecY, vecZ** *{double}* - Vector3 Object  
**playerId** *{string}* - unique player id, for example `xf8i`  
**nickname** *{string}* - any player username
**speed** *{double}* - player speed  
**acceleration** *{double}* - player acceleration

**|** is delimiter inside message to be able to parse properties  
**~** is delimiter between messages (mark the end of message)

All other are big CONSTANT strings which are special actions.  


### Client to server:

```
CONNECT|nickname~
LOCATION|x|y|z~
MOVE|vecX|vecY|vecZ|speed|acceleration~
ROTATION|vecX|vecY|vecZ~
STOP|x|y|z~
PICK~
THROW|vecX|vecY|vecZ|speed|acceleration~
HIT|playerId~
DEATH~
DISCONNECT~
```

### Server to client:

```
CONNECTED|playerId~
playerId|CONNECTED|nickname~
playerId|LOCATION|x|y|z~
playerId|MOVE|vecX|vecY|vecZ|speed|acceleration~
playerId|STOP|x|y|z~
playerId|PICK~
playerId|THROW|vecX|vecY|vecZ|speed|acceleration~
playerId|HIT~
playerId|DEATH~
playerId|REVIVE~
playerId|DISCONNECT~
```
{'fraction_non_alphanumeric': 0.13350367294793997, 'fraction_numerical': 0.0012775471095496647, 'mean_word_length': 6.676470588235294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2690976', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1159, 'n_words': 252}