// 将一条消息加入信息发送区并将该发送信息数据结构返回给请求的管理器
    public MessageToBeSent AddMessageInSendList(string AddMessageString)
    {
        MessageToBeSent NewMessageToBeSent = new MessageToBeSent(AddMessageString);

        MessageInSendList.Add(NewMessageToBeSent);
        return(NewMessageToBeSent);
    }
示例#2
0
    public void OnClickStartGameButton()
    {
        Debug.Log("Start Game button pressed.");

        // 生成发送信息
        string SendMessage = "RoomOrder " + GameRoomID.ToString() + " RoomStart ";

        // 通知网络管理器发送信息
        CurrentMessageToBeSent = NetworkManager.GetComponent <NetworkController>().AddMessageInSendList(SendMessage);

        // 显示 正在连接 提示信息
        HintMessageManager.GetComponent <HintMessageController>().ShowHintMessage("Connecting");
    }
示例#3
0
    public void OnClickBuyCardPack120()
    {
        // 将当前商城订单号包含在数据包中
        int CurrentShopOrderNumber = ClientPlayerManager.GetComponent <ClientPlayerController>().GetShopOrderNumber();

        // 生成发送信息
        string SendMessage = "UserBuy CardPack 120 " + CurrentShopOrderNumber.ToString() + " ";

        // 通知网络管理器发送信息
        CurrentMessageToBeSent = NetworkManager.GetComponent <NetworkController>().AddMessageInSendList(SendMessage);

        // 显示 正在连接 提示信息
        HintMessageManager.GetComponent <HintMessageController>().ShowHintMessage("Connecting");
    }
示例#4
0
    public void OnClickFreedomDay()
    {
        // 点击关卡按钮后首先生成房间管理器实例并通知房间管理器从XML中获取房间配置信息
        CurrentRoomManager      = GameObject.Instantiate(RoomManagerPrefab);
        CurrentRoomManager.name = "GameRoomManager";
        CurrentRoomManager.GetComponent <GameRoomController>().LoadRoomConfigFromXML("FreedomDay");

        // 将建立房间的当前用户设置为房主
        CurrentRoomManager.GetComponent <GameRoomController>().SetMasterFlag(true);


        // 生成发送信息
        string SendMessage = "UISPR FreedomDay ";

        // 通知网络管理器发送信息
        CurrentMessageToBeSent = NetworkManager.GetComponent <NetworkController>().AddMessageInSendList(SendMessage);

        // 显示 正在连接 提示信息
        HintMessageManager.GetComponent <HintMessageController>().ShowHintMessage("Connecting");
    }