コード例 #1
0
    public void Reset(bool exit = false)
    {
        if (null != c)
        {
            c.Destroy();
        }
        c = null;
        if (null != s)
        {
            s.Destroy();
        }
        if (exit)
        {
            return;
        }

        m_state       = WorldState.CENTER;
        m_state_extra = WorldStateExtra.WORLDSTATE_1;
        TurnCamera(true);

        s    = null;
        type = (GameMgrType)0;
        ObjectMgr.Instance.Clear();
        player_pool.ClearAndRealloc();
        bomb_pool.ClearAndRealloc();
        pwr_up_pool.ClearAndRealloc();
        if (maps != null)
        {
            maps.Clear();
        }
        game_started = false;
        StopAllCoroutines();
        Async.Instance.Restart();
    }
コード例 #2
0
 public void StartServer()
 {
     s = new Server(gameIntel.nb_players);
     ServerHandler.current = s;
     s.SetHandler(ServerHandler.handlers);
     type |= GameMgrType.SERVER;
 }
コード例 #3
0
 public bool StartClient(string address)
 {
     type |= GameMgrType.CLIENT;
     c     = new Client(address);
     ClientHandler.current = c;
     if ((type & GameMgrType.SERVER) != 0)
     {
         c.Both = true;
     }
     c.SetHandler(ClientHandler._handlers);
     if (c.Connect())
     {
         c.SendPacket(PacketBuilder.BuildConnectPacket(c.Both ? 4 : 0, 0));
         return(true);
     }
     else
     {
         return(false);
     }
 }