Shadowrun: Awakened 29 September 2011 - Build 871
ZoneServer.h
Go to the documentation of this file.
00001 /*
00002 * Zone Server - The zone server keeps track of all running udk server processes.
00003 *               If a client is trying to connect to a new zone, the zone server spawns
00004 *               a new process.
00005 *
00006 * @Author Michael Matzen <mim@informatik.uni-kiel.de>
00007 *
00008 * This program is free software; you can redistribute it and/or modify it
00009 * under the terms of the GNU General Public License as published by the Free
00010 * Software Foundation; either version 2 of the License, or (at your option)
00011 * any later version.
00012 *
00013 * This program is distributed in the hope that it will be useful, but WITHOUT
00014 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00015 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00016 * more details.
00017 *
00018 * You should have received a copy of the GNU General Public License along with
00019 * this program; if not, write to the Free Software Foundation, Inc., 51
00020 * Franklin St, Fifth Floor, Boston, MA 02110, USA
00021 * 
00022 */
00023 #pragma once
00024 
00025 #include "SraNetworkShared.h"
00026 #include <map>
00027 #include <stdio.h>
00028 #include <sstream>
00029 
00030 #include "RakPeerInterface.h"
00031 
00032 //If we want to use a unix-based server, we have to change this, and the spawnZone method
00033 #include <Windows.h>
00034 
00035 using namespace RakNet;
00036 
00037 namespace SraNetwork {
00038 class ZoneServer
00039 {
00040     struct ZoneInfo {
00041         //int zoneID; //zone id as stored in the database
00042         PROCESS_INFORMATION procInfo;
00043         //short numberOfPlayers;
00044         int zonePort;
00045     };
00046 public:
00047     ZoneServer(void);
00048     ~ZoneServer(void);
00049 
00050     void Run();
00051 private:
00055     bool spawnZone(int zoneID, int port);
00059     void shutdownZone( int zoneID );
00060     RakPeerInterface *m_rServerInterface;
00064     std::map<int, ZoneInfo> m_mZones;
00065 };
00066 }
00067 

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net