Ejemplo n.º 1
0
    public static void SendGameBegin()
    {
        GameBeginReq req = new GameBeginReq();

        req.acc_id = GameSystem.Instance.AccountID;
        if (conn != null)
        {
            conn.SendPack(0, req, MsgID.GameBeginReqID);
        }
    }
Ejemplo n.º 2
0
    public static void SendGameBegin()
    {
        NetworkConn conn = GameSystem.Instance.mNetworkManager.m_gameConn;

        if (conn == null)
        {
            return;
        }

        GameBeginReq gameBeginReq = new GameBeginReq();

        gameBeginReq.acc_id = MainPlayer.Instance.AccountID;

        GameSystem.Instance.mNetworkManager.m_gameConn.SendPack <GameBeginReq>(0, gameBeginReq, MsgID.GameBeginReqID);
    }
Ejemplo n.º 3
0
    public void OnGameBegin(GameBeginReq req)
    {
        if (running)
        {
            return;
        }

        ClientInput input = new ClientInput();

        input.acc_id           = req.acc_id;
        lastInputs[req.acc_id] = input;

        ++readyPlayerNum;
        if (readyPlayerNum >= playerNum)
        {
            running = true;
            GameBeginResp resp = new GameBeginResp();
            resp.seed = (uint)IM.Random.Range(0L, (long)uint.MaxValue);
            GameMsgSender.SendGameBeginResp(resp);
        }
    }
Ejemplo n.º 4
0
    //For virtual game server
    void HandleGameBeginReq(Pack pack)
    {
        GameBeginReq req = Serializer.Deserialize <GameBeginReq>(new MemoryStream(pack.buffer));

        VirtualGameServer.Instance.OnGameBegin(req);
    }