Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MMORPG Server

Buzzvil
December 01, 2021

MMORPG Server

By Alan

Buzzvil

December 01, 2021
Tweet

More Decks by Buzzvil

Other Decks in Programming

Transcript

  1. Game Server 의 종류 - Simple servier exports.createAccount = function(req,

    res) { User.createAccount(req.body.deviceId, req.body.id, req.body.pw, function(err, session) { return common.sendJson(res, {'sessionKey': session.key}); }); }; exports.login = function(req, res) ...생략… exports.submitScore = function(req, res) ...생략… exports.getRankings = function(req, res) ...생략… exports.getProducts = function(req, res) ...생략…
  2. Game Server 의 종류 - Realtime network (P2P/Central) Command를 Frame

    번호와 함께 서버로 전송 출처 Server
  3. Game Server 의 종류 - Realtime network (P2P/Central) 출처: Authority

    Distribution in a Proxy-Based Massively Multiplayer Game Architecture Justin F. Christofoli
  4. Game Server 의 종류 - Realtime network (P2P/Central) // TCP

    소켓 사용 / Packet 단위 처리 // GameSession.java // 10 ticks / second public void read(Buffer rbuff) { Packet inpkt; while ((inpkt = receivePacket(rbuff)) != null) { processProtocols(inpkt); } } public void processProtocols(Packet packet) throws Throwable { int opCode=packet.buffer().getShort(); switch (opCode) { case OP_COMMAND: processCommand(packet); Break; … 생략 … } } private void processCommand(Packet packet) { gameFrame=match.getFrame(); if (packet.hasRemaining()) { match.putCommand(this, packet); } }
  5. Game Server 의 종류 - MMORPG 월드맵 // Creature.m -

    attack:(int)weapon victim:(Creature*)victim damage:(int)damage { void effect(Creature* obj) { [obj notifyFight:weapon attacker: self victim: victim at: [victim point] sound: sound damage: damage]; } [[victim world] doCreatures: (Function) effect visible: [victim view]]; } // World.m + initialize { // local world pool } - doUsers: (Function) function ...