本文整理汇总了C#中IPacketGCMsg类的典型用法代码示例。如果您正苦于以下问题:C# IPacketGCMsg类的具体用法?C# IPacketGCMsg怎么用?C# IPacketGCMsg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPacketGCMsg类属于命名空间,在下文中一共展示了IPacketGCMsg类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HandleWelcome
//Initial message sent when connected to the GC
private void HandleWelcome(IPacketGCMsg msg)
{
gcConnectTimer.Stop();
Ready = true;
// Clear these. They will be updated in the subscriptions if they exist still.
Lobby = null;
Party = null;
PartyInvite = null;
var wel = new ClientGCMsgProtobuf<CMsgClientWelcome>(msg);
Client.PostCallback(new GCWelcomeCallback(wel.Body));
//Handle any cache subscriptions
foreach (CMsgSOCacheSubscribed cache in wel.Body.outofdate_subscribed_caches)
foreach (CMsgSOCacheSubscribed.SubscribedType obj in cache.objects)
HandleSubscribedType(obj);
UploadRichPresence();
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:22,代码来源:DotaGCHandler.cs
示例2: OnWelcome
private void OnWelcome(uint appID, IPacketGCMsg packetMsg)
{
var msg = new ClientGCMsgProtobuf<CMsgClientWelcome>(packetMsg).Body;
var info = GetSessionInfo(appID);
string message = string.Format("{0}{1}{2} new GC session", Colors.BLUE, Steam.GetAppName(appID), Colors.NORMAL);
if (info.Version == 0 || info.Version == msg.version)
{
message += string.Format(" {0}(version {1})", Colors.DARKGRAY, msg.version);
}
else
{
message += string.Format(" {0}(version changed from {1} to {2})", Colors.DARKGRAY, info.Version, msg.version);
IRC.Instance.SendMain(message);
}
IRC.Instance.SendAnnounce(message);
info.Version = msg.version;
info.Status = GCConnectionStatus.GCConnectionStatus_HAVE_SESSION;
}
开发者ID:GoeGaming,项目名称:SteamDatabaseBackend,代码行数:24,代码来源:GameCoordinator.cs
示例3: OnClientWelcome
// this message arrives when the GC welcomes a client
// this happens after telling steam that we launched dota (with the ClientGamesPlayed message)
// this can also happen after the GC has restarted (due to a crash or new version)
void OnClientWelcome( IPacketGCMsg packetMsg )
{
// in order to get at the contents of the message, we need to create a ClientGCMsgProtobuf from the packet message we recieve
// note here the difference between ClientGCMsgProtobuf and the ClientMsgProtobuf used when sending ClientGamesPlayed
// this message is used for the GC, while the other is used for general steam messages
var msg = new ClientGCMsgProtobuf<CMsgClientWelcome>( packetMsg );
Console.WriteLine( "GC is welcoming us. Version: {0}", msg.Body.version );
Console.WriteLine( "Requesting details of match {0}", matchId );
// at this point, the GC is now ready to accept messages from us
// so now we'll request the details of the match we're looking for
var requestMatch = new ClientGCMsgProtobuf<CMsgGCMatchDetailsRequest>( ( uint )EDOTAGCMsg.k_EMsgGCMatchDetailsRequest );
requestMatch.Body.match_id = matchId;
gameCoordinator.Send( requestMatch, APPID );
}
开发者ID:samphippen,项目名称:steamre,代码行数:22,代码来源:DotaClient.cs
示例4: OnItemBroadcast
private void OnItemBroadcast(uint appID, IPacketGCMsg packetMsg)
{
if (appID != 440)
{
// This message should be TF2 specific, but just in case
return;
}
var msg = new ClientGCMsgProtobuf<CMsgGCTFSpecificItemBroadcast>(packetMsg).Body;
var itemName = GetItemName(441, msg.item_def_index);
IRC.Instance.SendMain("{0}{1}{2} item notification: {3}{4}{5} {6} {7}{8}{9}!",
Colors.BLUE, Steam.GetAppName(appID), Colors.NORMAL,
Colors.BLUE, msg.user_name, Colors.NORMAL,
msg.was_destruction ? "has destroyed their" : "just received a",
Colors.OLIVE, itemName, Colors.NORMAL
);
}
开发者ID:GoeGaming,项目名称:SteamDatabaseBackend,代码行数:19,代码来源:GameCoordinator.cs
示例5: OnSystemMessage
private void OnSystemMessage(uint appID, IPacketGCMsg packetMsg)
{
var msg = new ClientGCMsgProtobuf<CMsgSystemBroadcast>(packetMsg).Body;
IRC.Instance.SendMain("{0}{1}{2} system message:{3} {4}", Colors.BLUE, Steam.GetAppName(appID), Colors.NORMAL, Colors.OLIVE, msg.message);
}
开发者ID:GoeGaming,项目名称:SteamDatabaseBackend,代码行数:6,代码来源:GameCoordinator.cs
示例6: Run
internal abstract void Run( IPacketGCMsg msg );
开发者ID:Netshroud,项目名称:steam-irc-bot,代码行数:1,代码来源:GCManager.cs
示例7: OnWelcome
private void OnWelcome(uint appID, IPacketGCMsg packetMsg)
{
uint version = 0;
switch (appID)
{
case 730:
version = new ClientGCMsgProtobuf<SteamKit2.GC.CSGO.Internal.CMsgClientWelcome>(packetMsg).Body.version;
break;
case 440:
version = new ClientGCMsgProtobuf<SteamKit2.GC.TF2.Internal.CMsgClientWelcome>(packetMsg).Body.version;
break;
default:
version = new ClientGCMsgProtobuf<CMsgClientWelcome>(packetMsg).Body.version;
break;
}
var info = GetSessionInfo(appID);
string message = string.Format("{0}{1}{2} new GC session", Colors.BLUE, Steam.GetAppName(appID), Colors.NORMAL);
if (info.Version == 0 || info.Version == version)
{
message += string.Format(" {0}(version {1})", Colors.DARKGRAY, version);
}
else
{
message += string.Format(" {0}(version changed from {1} to {2})", Colors.DARKGRAY, info.Version, version);
}
IRC.Instance.SendAnnounce(message);
info.Version = version;
info.Status = GCConnectionStatus.GCConnectionStatus_HAVE_SESSION;
}
开发者ID:qyh214,项目名称:SteamDatabaseBackend,代码行数:37,代码来源:GameCoordinator.cs
示例8: HandleCacheSubscribed
private void HandleCacheSubscribed(IPacketGCMsg obj)
{
var sub = new ClientGCMsgProtobuf<CMsgSOCacheSubscribed>(obj);
foreach (CMsgSOCacheSubscribed.SubscribedType cache in sub.Body.objects)
{
HandleSubscribedType(cache);
}
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:8,代码来源:DotaGCHandler.cs
示例9: HandleCacheDestroy
/// <summary>
/// Handle when a cache is destroyed.
/// </summary>
/// <param name="obj">Message</param>
public void HandleCacheDestroy(IPacketGCMsg obj)
{
var dest = new ClientGCMsgProtobuf<CMsgSOSingleObject>(obj);
if (PartyInvite != null && dest.Body.type_id == (int) CSOTypes.PARTYINVITE)
{
PartyInvite = null;
Client.PostCallback(new PartyInviteLeave(null));
}
else if (Lobby != null && dest.Body.type_id == (int) CSOTypes.LOBBY)
{
Lobby = null;
Client.PostCallback(new PracticeLobbyLeave(null));
}
else if (Party != null && dest.Body.type_id == (int) CSOTypes.PARTY)
{
Party = null;
Client.PostCallback(new PartyLeave(null));
}
else if (LobbyInvite != null && dest.Body.type_id == (int) CSOTypes.LOBBYINVITE)
{
LobbyInvite = null;
Client.PostCallback(new LobbyInviteLeave(null));
}
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:28,代码来源:DotaGCHandler.cs
示例10: HandleProfileCardResponse
private void HandleProfileCardResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAProfileCard>(obj);
Client.PostCallback(new ProfileCardResponse(resp.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:5,代码来源:DotaGCHandler.cs
示例11: HandleInvitationCreated
private void HandleInvitationCreated(IPacketGCMsg obj)
{
var msg = new ClientGCMsgProtobuf<CMsgInvitationCreated>(obj);
Client.PostCallback(new InvitationCreated(msg.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:5,代码来源:DotaGCHandler.cs
示例12: HandleGuildData
private void HandleGuildData(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildSDO>(obj);
Client.PostCallback(new GuildDataResponse(resp.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:5,代码来源:DotaGCHandler.cs
示例13: HandleGuildCancelInviteResponse
private void HandleGuildCancelInviteResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildCancelInviteResponse>(obj);
Client.PostCallback(new GuildCancelInviteResponse(resp.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:5,代码来源:DotaGCHandler.cs
示例14: HandleGuildAccountRoleResponse
private void HandleGuildAccountRoleResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildSetAccountRoleResponse>(obj);
Client.PostCallback(new GuildSetRoleResponse(resp.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:5,代码来源:DotaGCHandler.cs
示例15: OnItemSchemaUpdate
private void OnItemSchemaUpdate(IPacketGCMsg packetMsg)
{
var msg = new ClientGCMsgProtobuf<CMsgUpdateItemSchema>(packetMsg).Body;
if (LastSchemaVersion != 0 && LastSchemaVersion != msg.item_schema_version)
{
Log.WriteInfo(Name, "Schema change from {0} to {1}", LastSchemaVersion, msg.item_schema_version);
IRC.SendMain("{0}{1}{2} item schema updated: {3}{4}{5} -{6} {7}", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL, Colors.DARK_GRAY, msg.item_schema_version.ToString("X4"), Colors.NORMAL, Colors.DARK_BLUE, msg.items_game_url);
}
LastSchemaVersion = msg.item_schema_version;
}
开发者ID:TomasDuda,项目名称:SteamDatabaseBackend,代码行数:13,代码来源:GameCoordinator.cs
示例16: HandleCacheUnsubscribed
private void HandleCacheUnsubscribed(IPacketGCMsg obj)
{
var unSub = new ClientGCMsgProtobuf<CMsgSOCacheUnsubscribed>(obj);
if (Lobby != null && unSub.Body.owner_soid.id == Lobby.lobby_id)
{
Lobby = null;
Client.PostCallback(new PracticeLobbyLeave(unSub.Body));
}
else if (Party != null && unSub.Body.owner_soid.id == Party.party_id)
{
Party = null;
Client.PostCallback(new PartyLeave(unSub.Body));
}
else if (PartyInvite != null && unSub.Body.owner_soid.id == PartyInvite.group_id)
{
PartyInvite = null;
Client.PostCallback(new PartyInviteLeave(unSub.Body));
}
else
Client.PostCallback(new CacheUnsubscribed(unSub.Body));
}
开发者ID:vhsoaresr,项目名称:Dota2,代码行数:21,代码来源:DotaGCHandler.cs
示例17: OnSystemMessage
private void OnSystemMessage(IPacketGCMsg packetMsg)
{
var msg = new ClientGCMsgProtobuf<CMsgSystemBroadcast>(packetMsg).Body;
Log.WriteInfo(Name, "Message: {0}", msg.message);
IRC.SendMain("{0}{1}{2} system message:{3} {4}", Colors.OLIVE, SteamProxy.GetAppName(AppID), Colors.NORMAL, Colors.OLIVE, msg.message);
}
开发者ID:TomasDuda,项目名称:SteamDatabaseBackend,代码行数:8,代码来源:GameCoordinator.cs
示例18: OnClientWelcome
void OnClientWelcome( IPacketGCMsg msg )
{
var clientWelcome = new ClientGCMsgProtobuf<CMsgClientWelcome>( msg );
clientVersion = clientWelcome.Body.version;
DebugLog.WriteLine( "DotaGCClient", "GC is version {0}", clientWelcome.Body.version );
var findGames = new ClientGCMsgProtobuf<CMsgFindSourceTVGames>( EGCMsg.FindSourceTVGames );
findGames.Body.num_games = 10;
SteamGameCoordinator.Send( findGames, APPID );
}
开发者ID:KimimaroTsukimiya,项目名称:DotaBot,代码行数:12,代码来源:DotaGCClient.cs
示例19: OnSourceTVGames
void OnSourceTVGames( IPacketGCMsg msg )
{
var gamesList = new ClientGCMsgProtobuf<CMsgSourceTVGamesResponse>( msg );
DebugLog.WriteLine( "DotaGCClient", "There are currently {0} viewable games", gamesList.Body.num_total_games );
var game = gamesList.Body.games[ 0 ];
var watchGame = new ClientGCMsgProtobuf<CMsgWatchGame>( EGCMsg.WatchGame );
watchGame.Body.client_version = clientVersion;
watchGame.Body.server_steamid = game.server_steamid;
SteamGameCoordinator.Send( watchGame, APPID );
}
开发者ID:KimimaroTsukimiya,项目名称:DotaBot,代码行数:14,代码来源:DotaGCClient.cs
示例20: OnConnectionStatus
private void OnConnectionStatus(uint appID, IPacketGCMsg packetMsg)
{
var msg = new ClientGCMsgProtobuf<CMsgConnectionStatus>(packetMsg).Body;
GetSessionInfo(appID).Status = msg.status;
string extraInfo = string.Empty;
if (msg.status == GCConnectionStatus.GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE)
{
extraInfo = string.Format(" {0}(queue: {1}/{2}, waited {3} of an estimated {4} seconds)",
Colors.DARKGRAY, msg.queue_position, msg.queue_size, msg.wait_seconds, msg.estimated_wait_seconds_remaining
);
}
IRC.Instance.SendAnnounce("{0}{1}{2} status:{3} {4}{5}", Colors.BLUE, Steam.GetAppName(appID), Colors.NORMAL, Colors.OLIVE, msg.status, extraInfo);
}
开发者ID:GoeGaming,项目名称:SteamDatabaseBackend,代码行数:17,代码来源:GameCoordinator.cs
注:本文中的IPacketGCMsg类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论