Package com.golden.gamedev.engine

Examples of com.golden.gamedev.engine.BaseServer


    // we need to register our custom packet first
    NetworkConfig.registerPacket((short) 1, AllFieldTypePacket.class);
    NetworkConfig.DEBUG = true;
   
    try {
      BaseServer bsServer = new TCPServer(port); // create the server
     
      System.out.println("Waiting for clients...");
     
      // network loop
      while (true) {
        bsServer.update(100); // the main work
       
        // iterate all received packets
        BaseClient[] clients = bsServer.getReceivedPacketClients();
        for (int i = 0; i < clients.length; i++) {
          NetworkPacket[] packets = clients[i].getReceivedPackets();
         
          // simply send back message OK
          clients[i]
View Full Code Here

TOP

Related Classes of com.golden.gamedev.engine.BaseServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.