It has too much things in it - database loading, packet sending, general bad code.
Database loading should be separated into data access classes and ORM if necessary.
Cohesive classes should be created to encapsulate the packet sending for each operation.
It has too much things in it - database loading, packet sending, general bad code.
Database loading should be separated into data access classes and ORM if necessary. Cohesive classes should be created to encapsulate the packet sending for each operation.