Giter Site home page Giter Site logo

helen's People

Contributors

dschalla avatar gpittarelli avatar ldesgoui avatar lense avatar mcapu avatar vibhavp avatar zygi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helen's Issues

Sending lobbyJoin while being in another lobby.

Right now, when you're in a lobby spot and you try to join a spot in a different lobby, you'll get an error saying "Player is already in a lobby". I suggest that Helen removes the player from his original spot and lets him join the new lobby.

Client timeout

Users need to be timed out and removed from lobby slots if they have no active websocket connections for some period of time (2 minutes-ish?)

Sending too many lobbyData messages

When clients send lobbyJoin, they tend to receive multiple redundant messages (described below) (all before the lobbyJoin response).

This includes (sometimes duplicated) copies of the lobbyData with them not in their old slot, and then (again, sometimes duplicated 2+ times) copies of the lobbyData with them in their new slot.

Interspersed are also multiple lobbyListData messages.

Send league on `lobbyData`

If possible, make it either:

  • Have two fields: name (e.g. AsiaFortress) and value (asiafortress).
  • Only send the name, since it's what will be displayed on the page. However, this might change in the future, so the first option would be wiser.

Server model

Have a server model that would use the Rcon wrapper and have functions like verify and setup. Find a place to store configs, read them and execute them during setup. (the wrapper has a method ExecConfig(config string))

Player can ban himself from his own lobby

Sending lobbyKick with ban=true should return an error if the steamid is empty or equal to the sender. In other cases, a new leader should be assigned (I suggest that if a user with role admin or moderator bans the lobby leader, he gets assigned as the new leader).

Data Race during DB Migration

Build Helen with go build -race, execute the generated binary.

Complete data race info from the Go data race tool:

WARNING: DATA RACE
Read by goroutine 9:
runtime.mapaccess2()
/build/go/src/go-1.5.1/src/runtime/hashmap.go:320 +0x0
github.com/jinzhu/gorm.(_Scope).GetModelStruct()
/home/vibhavp/go/src/github.com/jinzhu/gorm/model_struct.go:94 +0x2f5
github.com/jinzhu/gorm.(_Scope).GetStructFields()
/home/vibhavp/go/src/github.com/jinzhu/gorm/model_struct.go:380 +0x41
github.com/jinzhu/gorm.(*Scope).GetModelStruct.func1()
/home/vibhavp/go/src/github.com/jinzhu/gorm/model_struct.go:291 +0x656c

Previous write by main goroutine:
runtime.mapassign1()
/build/go/src/go-1.5.1/src/runtime/hashmap.go:411 +0x0
github.com/jinzhu/gorm.(_Scope).GetModelStruct()
/home/vibhavp/go/src/github.com/jinzhu/gorm/model_struct.go:372 +0x1037
github.com/jinzhu/gorm.(_Scope).TableName()
/home/vibhavp/go/src/github.com/jinzhu/gorm/scope.go:282 +0x2f6
github.com/jinzhu/gorm.(_Scope).autoMigrate()
/home/vibhavp/go/src/github.com/jinzhu/gorm/scope_private.go:586 +0x52
github.com/jinzhu/gorm.(_DB).AutoMigrate()
/home/vibhavp/go/src/github.com/jinzhu/gorm/main.go:411 +0xf5
github.com/TF2Stadium/Helen/database/migrations.Do()
/home/vibhavp/go/src/github.com/TF2Stadium/Helen/database/migrations/migrations.go:13 +0x13f
main.main()
/home/vibhavp/go/src/github.com/TF2Stadium/Helen/main.go:33 +0x62

Goroutine 9 (running) created at:
github.com/jinzhu/gorm.(_Scope).GetModelStruct()
/home/vibhavp/go/src/github.com/jinzhu/gorm/model_struct.go:370 +0xfc1
github.com/jinzhu/gorm.(_Scope).TableName()
/home/vibhavp/go/src/github.com/jinzhu/gorm/scope.go:282 +0x2f6
github.com/jinzhu/gorm.(_Scope).autoMigrate()
/home/vibhavp/go/src/github.com/jinzhu/gorm/scope_private.go:586 +0x52
github.com/jinzhu/gorm.(_DB).AutoMigrate()
/home/vibhavp/go/src/github.com/jinzhu/gorm/main.go:411 +0xf5
github.com/TF2Stadium/Helen/database/migrations.Do()
/home/vibhavp/go/src/github.com/TF2Stadium/Helen/database/migrations/migrations.go:13 +0x13f
main.main()
/home/vibhavp/go/src/github.com/TF2Stadium/Helen/main.go:33 +0x62

Send lobbyStart/lobbyReadyUp upon connection.

If the player connection to the backend drops for any reason and the lobby is in the ready-up state or has already started, the Frontend will never receive those requests and it'll be impossible to retrieve the information.

Alternatively, and I think this is a better solution, send the lobby connection information in lobbyData, but only to the players, and only if the lobby has already started. That way we can avoid non-players getting the info to attack the lobby.

Set up the asset pipeline

RoR description: "The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB."

As for golang, https://github.com/shaoshing/train looks like an all-around good system for that so I think integrating it would be a good choice. If that doesn't work, SASS compilation (and probably fingerprinting) would need to be added manually.

The current idea is to use gulp for that.

Message responses are quoted too much

For example (with the wsevent wrapping):

Send: {"id":"1","data":{"id":6,"team":"blu","class":"scout","request":"lobbyJoin"}}
Receive: {id":"1","data":""{\"data\":{},\"success\":true}""}

Where as the following would be expected:

Send: {"id":"1","data":{"id":6,"team":"blu","class":"scout","request":"lobbyJoin"}}
Receive: {id":"1","data":"{"data":{},"success":true}"}

(and really, the fact that data is an object client->server but a string server->client is quite inconsistent)

lobbyData not sent if client spectates already joined lobby

A client that sends lobbyJoin and then lobbySpectatorJoin (for the same lobby id) will receive a single lobbyData message, but then no more. This behavior can be demonstrated on the current frontend by clicking to join a lobby slot directly from the lobby list.

Handle errors while configuring servers

While setting up a server, we can encounter the follow errors:

passErr := s.Rcon.ChangeServerPassword(s.LobbyPassword)
kickErr := s.KickAll()
cfg, cfgErr := config.Get()
configErr := s.ExecConfig(config)
mapErr := s.Rcon.ChangeMap(s.Map)

These errors need to appropriately converted to TPError type and sent to the user. In case of errors like mapErr, a correct map needs to be taken by the user, and then changed.

Sender does not receive chatReceive Event

In order to receive the role of the sender it would be useful that also the sender of the chatSend event receives the chatRecevie event. Alternative would be to send the data in the callback?

Add socket to rooms when reconnecting

Currently sockets are only added to rooms after lobbyJoin messages. This is bad if the server or a client temporarily loses connection and reconnects - we should add new sockets to rooms they should belong to on connection

Multiple bugs

  • When someone reconnect, make them join the public AND private rooms of the lobby they're PLAYING.
  • On lobbyJoin, make them join the PRIVATE ROOM, on lobbySpectatorJoin, make them join the PUBLIC ROOM
  • When someone disconnects, we get the Steam ID from their socket ID, then check if there are multiple connected sockets for that SteamID. If there no more sockets left (no tabs): We remove them from the spectator of the lobby they were spectating. If there are sockets left*, we check if these sockets are spectating the same lobbies the previous socket was. If no, the player is removed the from the spectator slot of these lobbies.

Users can join lobbies after they are closed.

Also, you don't get removed from the spots you're already in, which means you can open a lobby, close it, then fill every single slot by yourself, receive lobbyReadyUp and start the lobby with one player.

Broadcast lobbyJoin/lobbyKick messages as events to everyone

Currently those messages are sent strictly to the related parties (and sometimes not even then: eg if a player gets kicked by lobby leader, the kicked player doesn't get a lobbyKick message, he just gets new lobbyData without him in his slot).

It would be both more efficient to only send the changed data, and makes things significantly easier for the frontend.

Today's many bugs

  • The server crashes when someone connects with a token which is not in the DB
  • PlayerStatsScraper response parsing issues
  • RconWrapper GetPlayers crashes at line 63

Deployment

Work on setting up some kind of deployment pipeline. A CI system would be ideal, but a nice build and run script would be enough for now.

Set up mongodb integration

We'll use mongodb for persistent storage. You need to integrate http://labix.org/mgo with the project and write a few examples (like saving and loading player models from the database) (the player model is definitely not yet finalized so don't spend a lot of time on that - just make sure it works)

lobbyData does not contain envelop

When being a player in a lobby and receiving its updates, the message sent by the server does not contain a envelop/event name?

WebSocket extract:

42["lobbyListData","{\"lobbies\":[{\"classes\":{\"demoman\":{\"blu\"[...]

LobbyData:

42["{\"classes\":{\"demoman\":{\"blu\":{\"name\":\[...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.