Giter VIP home page Giter VIP logo

potatochatprotocol's Introduction

Hi, I'm Jacopo ๐Ÿ‡ฎ๐Ÿ‡น

professional by day, open source & weirdo by night

C# Rust
Python Java C++


I do embedded and webdev! I prefer embedded and desktop, tho

HTML5 CSS3
PHP Javascript Typescript Markdown
Bootstrap jQuery Spring Boot Node Red

SQLite SQL Server Redis PostgreSQL

Manjaro Ubuntu Windows


Feel free to reach me about my projects here on GitHub!

potatochatprotocol's People

Contributors

alessio789 avatar gfurri20 avatar jacopowolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

potatochatprotocol's Issues

First connections managed in PCPCore

The middlewere is able to distinguish between an existing and a new connection.
Given that the middleware is able correctly direct the byte[] to the right LogicCore, we could remove the separated management of incoming connections and pass those through the

Code style guide

below are accepted comments on which code style we should embrace.

My first suggestion are below:

  • interfaces start with an I ( like IPCPpacket )
  • every base class must first have a generic interface

Charset ISO/IEC-8859-1

version
PCP-Min.b.4

Describe the bug
The interpret doesn't use the chosen charset (ISO/IEC-8859-1)

Server port

We have to decide what port to assign to the server.
I propose <<53 101>>: "5e" in ASCII

First registration does not send the user list

version
PCP-Min.b.3

Describe the bug
A client that registers for the first time does not receive the list of users.

Expected behavior
A client that registers should receive both ack and user list.

Write documentation for all classes

this is a reminder to write documentation for everything.
Doesn't have to be done right now, but before the project finishes, this should be done.

PCPManager doesn't update incomplete data time-to-live correctly

version
PCP-Min.a.2

Describe the bug
Incomplete data packages time-to-live is not updated before the cache cleaning death reaper deletes them even if still valid.
Set accessing methods should be exposed from PCPManager.

Expected behavior
datas time-to-live should be updated when the interpreter interprets new data

Training on junit tests

ok so you guys need to learn how junit tests work.
This is kinda an "officialization" and a reminder.

Meanwhile you could look at some documentation and videos online.

Test all classes

simple reminder to test every class in the APIs.
The important thing is tests are well written, but the code coverage goal is at least 40%

invalid field types

I've looked through all of the packet classes... I think some properties are of the wrong type.
especially in @Alessio789 's classes.

  • i think the assigned Id could be considered as an int or as a byte[], since it's a numeral, I don't see why it should be of type string. That's thoughout all of the classes.
  • json content in the PCPgroupUserList class can be a Collection or an ArrayList and operate the json string conversion while converting the package, or even creating a method, like jsonStringContent()

IPCPpacket interface modification and packets enhancement

  1. As implemented with commit 18642f5 classes now must implement byte[] header( ).
    I suggest using this method to simplify Collection<byte[]> toBytes() implementations.

  2. documentation for every class must be provided (obviusly not for overriden methods, as java overrides the documentation too).
    We need to close this first -sprint- and move on to develop the APIs asap. Clock's ticking, gentlemans.

Wrong check on topic length

version
PCP-Min.b.5

Describe the bug
In PCPMinInterpreter the accepted length for the topic ranges from 6 to 32 byte instead of 3 to 64 byte as specified in PCP-Min.md

PCPServer.shutDown() doesn't actually shutdown

version
PCP-Min.a.2

Describe the bug
calling PCPServer.shutdown() doesn't finalize all of the resources.
Probably some threads are still running unmanaged.

To Reproduce
Steps to reproduce the behavior:

  1. initialize a server
  2. try to stop a server in code
  3. the program will still be running

Expected behavior
The server should shut down and release all of the managed resources and interrupt all threads

Additional context
Tested on an Ubuntu Linux 18.04 machine.

Proposed solution
A disposing mechanism should be implemented for all classes in the server structure.
something like an IDisposable to allow deterministic and safe resource cleanup

New connections handling

the scheme works perfectly if we think about already established connections...

But i think we need a specialized logicCore with the sole purpose of establishing new connections, meaning it must implement methods with a reference to the original socket.

Like, instead of a queue it should contain two: one referencing sockets and the other the data recieved.

This way it could be able to update PCPSockets with the login information.

Feedback?

Vision statement

this issue will track the writing of the vision statement document

NullPointerException on get aliases by room

version
PCP-Min.b.3

Describe the bug
The method is executed even if the user list is empty.

Expected behavior
The method getAliasesByRoom() must control the number of users before proceeding.

message packets need a new structure

looking at it I've begun to think that message classes need to inherit from a major abstract APCPMessagePacket class (A is abstract).
The structure would be as following

  IPCPpacket
      โ†‘
AbsMessagePacket
โ†‘
|- UserToUser
|- UserToGroup
|- Recieved

Maybe a class for every packet type is a bit overkill?

Being the doubtful insecure idiot i am, looking at it again
got me the doubt that maybe this code design is a bit overkill or even plain wrong.
Initially i thought it might be a nice level of abstraction.

Opinions? I would like to know what @antosette has to say about that.

Review PCP-M.0 documentation

edit documentation with the following:

protocol

  • topic managment
  • only one public room ( general )
  • utf-8 charset (ASCII)
  • ids are private, as a basic security.measure

packets

  • version specification
  • a byte set to 0 to end a string field
  • no more connection type
  • user list update request
  • alias name change package
  • error 250: server exploded

Profanity manager

When a profanity has been sent to the server, all the users will receive a message by (you know who) which praises the sender

Everything's unsupported (template usage example issue)

this is a bug request but also it's supposed to be an example on how to use templates

version
development branch update-Min-async

Describe the bug
An UnsupportedOperationException is thrown during tests

To Reproduce
Execute PCPManager_Test.initialize()

Expected behavior
the mock server should answer with a serverexploded error packet and close the connecition

In-dept server design

I think the api should be designed following the strategy ( or as i call it, plug-and-play ) design pattern.
This means an hypotetical PCPServerSideConnection would envelop all of the other useful components, wich could be changed at runtime based on software version or even be shared between multiple consumers.

Server-side, this could imply developing a middleware to manage computational resources.
In the #3 scheme this could be positioned between Network and Socket layer.

I will draw a scheme when i have time.


PCPserverscheme

PCPVariablePayloads.toBytes() doesn't correctly format multiple packets

version
PCP-Min.a.2

Describe the bug
The PCPVariablePayloads.toBytes() method does not correctly format packets whose length is a multiple or greater than 2048

To Reproduce
Steps to reproduce the behavior:

  1. Create a PCPVariablePayload packet its length is greater than or equal to 2048
  2. Examinate the byte arrays length
  3. The values will not match what is expected

Expected behavior
If an istance of a packet which extends PCPVariablePayloads have total length:

  • multiple of 2048: the last packet has to containt only the header and eventually some delimitators, (packet length < 2048 obviously)
  • greater than 2048: the last packet length has to be equal to header length + last part of messagge + delimitators, (packet length < 2048 obviously)

From ArrayList<Obj> to Json

I'm thinking how to convert our ArrayList<String> listOfUSers in json format.
If I would use an external library (GSON), how can i do?

create tests for PCPMinInterpreter and IPCPManager

I propose tests for the interpreter could go in the same test classes of their respective PCPdata, as some sort of reverse engineering test.

Middlewere tests i think are gonna be the real complicated ones.

  • middlewere
  • interpreter

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.