本文整理汇总了C#中IPacketGCMsg类的典型用法代码示例。如果您正苦于以下问题:C# IPacketGCMsg类的具体用法?C# IPacketGCMsg怎么用?C# IPacketGCMsg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPacketGCMsg类属于命名空间,在下文中一共展示了IPacketGCMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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;
}
示例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 );
}
示例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
);
}
示例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);
}
示例6: Run
internal abstract void Run( IPacketGCMsg msg );
示例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;
}
示例8: HandleCacheSubscribed
private void HandleCacheSubscribed(IPacketGCMsg obj)
{
var sub = new ClientGCMsgProtobuf<CMsgSOCacheSubscribed>(obj);
foreach (CMsgSOCacheSubscribed.SubscribedType cache in sub.Body.objects)
{
HandleSubscribedType(cache);
}
}
示例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));
}
}
示例10: HandleProfileCardResponse
private void HandleProfileCardResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAProfileCard>(obj);
Client.PostCallback(new ProfileCardResponse(resp.Body));
}
示例11: HandleInvitationCreated
private void HandleInvitationCreated(IPacketGCMsg obj)
{
var msg = new ClientGCMsgProtobuf<CMsgInvitationCreated>(obj);
Client.PostCallback(new InvitationCreated(msg.Body));
}
示例12: HandleGuildData
private void HandleGuildData(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildSDO>(obj);
Client.PostCallback(new GuildDataResponse(resp.Body));
}
示例13: HandleGuildCancelInviteResponse
private void HandleGuildCancelInviteResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildCancelInviteResponse>(obj);
Client.PostCallback(new GuildCancelInviteResponse(resp.Body));
}
示例14: HandleGuildAccountRoleResponse
private void HandleGuildAccountRoleResponse(IPacketGCMsg obj)
{
var resp = new ClientGCMsgProtobuf<CMsgDOTAGuildSetAccountRoleResponse>(obj);
Client.PostCallback(new GuildSetRoleResponse(resp.Body));
}
示例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;
}