Coder Social home page Coder Social logo

jasbrake / acpinger Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 8 KB

A Golang library to ping AssaultCube servers and parse their responses.

License: MIT License

Go 100.00%
assaultcube fps fps-game game golang golang-library ping ping-pong pingpong pong tool

acpinger's People

Contributors

jasbrake avatar

Watchers

 avatar  avatar

acpinger's Issues

Invalid response is sent when a player times out

The Issue

Occasionally a player in the extended pong will have a ping of 9999 and the name will be empty. I think this happens when a player times out, given that 9999 is the max ping allowed by the server.

Resolution

I think we can safely skip adding any player with an empty name and a ping of 9999 to the player slice given that they appear to be disconnecting anyway.

Handle and return parsing errors

Attempting to parse a byte array that is too short results in a unhandled "index out of range" error. This can be prevented by checking if more bytes exist before trying to read and returning an error if they do not.

Provide more in depth examples

The tests are too simplistic and don't contain any examples of concurrency.

Some ideas for examples to provide:

  • A simple synchronous example
  • Concurrent pinging against multiple servers with a configurable amount of workers (modeled after the Share Memory By Communicating codewalk)

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.