예제 #1
0
        /// <summary>
        ///     Handles a client message. This should not be called directly.
        /// </summary>
        /// <param name="packetMsg">The packet message that contains the data.</param>
        public override void HandleMsg(IPacketMsg packetMsg)
        {
            if (packetMsg.MsgType == EMsg.ClientFromGC)
            {
                var msg = new ClientMsgProtobuf <CMsgGCClient>(packetMsg);
                if (msg.Body.appid == 570)
                {
                    IPacketGCMsg gcmsg      = GetPacketGCMsg(msg.Body.msgtype, msg.Body.payload);
                    var          messageMap = new Dictionary <uint, Action <IPacketGCMsg> >
                    {
                        { (uint)EGCBaseClientMsg.k_EMsgGCClientWelcome, HandleWelcome },
                        { (uint)EDOTAGCMsg.k_EMsgGCPracticeLobbyJoinResponse, HandlePracticeLobbyJoinResponse },
                        { (uint)EDOTAGCMsg.k_EMsgGCPracticeLobbyListResponse, HandlePracticeLobbyListResponse },
                        { (uint)ESOMsg.k_ESOMsg_CacheSubscribed, HandleCacheSubscribed },
                        { (uint)ESOMsg.k_ESOMsg_CacheUnsubscribed, HandleCacheUnsubscribed },
                        { (uint)ESOMsg.k_ESOMsg_Destroy, HandleCacheDestroy },
                        { (uint)EGCBaseClientMsg.k_EMsgGCPingRequest, HandlePingRequest },
                        { (uint)EDOTAGCMsg.k_EMsgGCJoinChatChannelResponse, HandleJoinChatChannelResponse },
                        { (uint)EDOTAGCMsg.k_EMsgGCChatMessage, HandleChatMessage },
                        { (uint)EDOTAGCMsg.k_EMsgGCOtherJoinedChannel, HandleOtherJoinedChannel },
                        { (uint)EDOTAGCMsg.k_EMsgGCOtherLeftChannel, HandleOtherLeftChannel },
                        { (uint)ESOMsg.k_ESOMsg_UpdateMultiple, HandleUpdateMultiple },
                        { (uint)EDOTAGCMsg.k_EMsgGCPopup, HandlePopup },
                        { (uint)EDOTAGCMsg.k_EMsgDOTALiveLeagueGameUpdate, HandleLiveLeageGameUpdate },
                        { (uint)EGCBaseMsg.k_EMsgGCInvitationCreated, HandleInvitationCreated },
                        { (uint)EDOTAGCMsg.k_EMsgGCMatchDetailsResponse, HandleMatchDetailsResponse },
                        { (uint)EGCBaseClientMsg.k_EMsgGCClientConnectionStatus, HandleConnectionStatus },
                        { (uint)EDOTAGCMsg.k_EMsgGCProTeamListResponse, HandleProTeamList },
                        { (uint)EDOTAGCMsg.k_EMsgGCFantasyLeagueInfo, HandleFantasyLeagueInfo },
                        { (uint)EDOTAGCMsg.k_EMsgGCPlayerInfo, HandlePlayerInfo }
                    };
                    Action <IPacketGCMsg> func;
                    if (!messageMap.TryGetValue(gcmsg.MsgType, out func))
                    {
                        Client.PostCallback(new UnhandledDotaGCCallback(gcmsg));
                        return;
                    }

                    func(gcmsg);
                }
            }
            else
            {
                if (packetMsg.IsProto && packetMsg.MsgType == EMsg.ClientUDSInviteToGame)
                {
                    var msg = new ClientMsgProtobuf <CMsgClientUDSInviteToGame>(packetMsg);
                    Invitation = msg.Body;
                    Client.PostCallback(new SteamPartyInvite(Invitation));
                }
            }
        }
예제 #2
0
 internal SteamPartyInvite(CMsgClientUDSInviteToGame msg)
 {
     result = msg;
 }