123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include <iostream>
- #include "server/GameServer.h"
- #include "server/commands/ConsoleEditor.h"
- #include "server/commands/CommandManager.h"
- GameServer::GameServer(const Clock& tps) : tps(tps) {
- }
- void GameServer::tick() {
- }
- void GameServer::handleCommands(ServerCommands& serverCommands) {
- String s;
- while(ConsoleEditor::readCommand(s)) {
- commandManager.execute(serverCommands, s);
- }
- }
- void GameServer::onFullServerClientConnect(Client& client) {
- (void) client;
- std::cout << "full\n";
- }
- void GameServer::onClientConnect(Client& client) {
- (void) client;
- std::cout << "connected\n";
- }
- void GameServer::onClientPackage(Client& client, Packet& packet) {
- (void) client;
- String s;
- while(packet.hasData()) {
- s.append(packet.readU8());
- }
- std::cout << "Packet: " << s << "\n";
- }
- void GameServer::onClientDisconnect(Client& client) {
- (void) client;
- std::cout << "disconnected\n";
- }
|