本文整理汇总了C#中SteamID类的典型用法代码示例。如果您正苦于以下问题:C# SteamID类的具体用法?C# SteamID怎么用?C# SteamID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SteamID类属于命名空间,在下文中一共展示了SteamID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Invoke
public bool Invoke()
{
return Task.Run( async () => {
try {
SteamID targetUser = new SteamID( "76561198129947779" );
SteamClient client = new SteamClient();
client.Authenticator = UserAuthenticator.ForProtectedResource( AccessConstants.OAuthAccessToken );
chatClient.SteamChatConnectionChanged += chatClient_SteamChatConnected;
chatClient.SteamChatMessagesReceived += chatClient_SteamChatMessagesReceived;
chatClient.SteamChatUserStateChange += chatClient_SteamChatUserStateChange;
chatClient.LogOn( client ).Wait();
while( true ) {
switch( WriteConsole.Prompt( "Command (msg, status): " ) ) {
case "msg": await chatClient.SendMessage( targetUser, WriteConsole.Prompt( "Type New Message: " ) ); break;
case "dcn": await chatClient.Disconnect(); break;
}
}
} catch( Exception e ) {
WriteConsole.Error( e.Message + "\n" + e.ToString() );
return false;
}
} ).Result;
}
开发者ID:chaoscode,项目名称:SteamSharp,代码行数:32,代码来源:ChatFlow.cs
示例2: SteamIDEquals
public void SteamIDEquals()
{
SteamID one = new SteamID( "76561198129947779" );
SteamID two = new SteamID( "76561198129947779" );
Assert.IsTrue( ( one == two ) );
}
开发者ID:chaoscode,项目名称:SteamSharp,代码行数:7,代码来源:Comparison.cs
示例3: GetUserStatInt
public GameServerStatsGetUserStatIntResult GetUserStatInt(SteamID steamIDUser, string name)
{
GameServerStatsGetUserStatIntResult result = new GameServerStatsGetUserStatIntResult();
result.Result = GetUserStat(steamIDUser, name, out result.IntValue);
return result;
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:8,代码来源:GameServerStats.cs
示例4: Update
public void Update()
{
Callback callback;
SteamCallHandle steamCall;
if ( Steamworks.Steam_BGetCallback( pipe, out callback, out steamCall ) )
{
if ( callback.CallbackNum == FriendChatMsg.Callback )
{
FriendChatMsg chatMsg = null;
try
{
chatMsg = ( FriendChatMsg )callback.CallbackObject;
}
catch
{
Steamworks.Steam_FreeLastCallback( pipe );
OnLogFailure( new LogFailureEventArgs( "Recieved callback was not in the correct format, call a programmer!" ) );
return;
}
string message = string.Empty;
FriendMsgType type;
SteamID reciever = new SteamID( chatMsg.Reciever );
steamFriends.GetChatMessage( reciever, ( int )chatMsg.ChatID, out message, 1024 * 4, out type );
LogMessage log = new LogMessage();
log.Sender = new SteamID( chatMsg.Sender );
log.SenderName = steamFriends.GetFriendPersonaName( log.Sender );
log.Reciever = reciever;
log.RecieverName = steamFriends.GetFriendPersonaName( log.Reciever );
log.Message = message;
log.MessageTime = DateTime.Now;
log.MessageType = type;
AddLog( log );
}
Steamworks.Steam_FreeLastCallback( pipe );
}
}
开发者ID:Drakulix,项目名称:TeknoMW3,代码行数:47,代码来源:LogManager.cs
示例5: GetTextureFromSteamID
//Thanks to Karl @ Stunlock Studios for giving me their function as he implemented utils.GetImage(Size/RGBA) into our library
public Texture2D GetTextureFromSteamID(SteamID steamId)
{
IFriends friends = Steamworks.SteamInterface.Friends;
IUtils utils = Steamworks.SteamInterface.Utils;
ImageHandle avatarHandle = friends.GetLargeFriendAvatar(steamId);
if (avatarHandle.IsValid)
{
uint width, height;
if (utils.GetImageSize(avatarHandle, out width, out height))
{
Texture2D texture = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, true);
Color32[] buffer = new Color32[width * height];
GCHandle bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
try
{
System.IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0);
if (utils.GetImageRGBA(avatarHandle, bufferPtr, (int)width * (int)height * 4))
{
// Flip vertical
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height / 2; y++)
{
Color32 temp = buffer[x + (width * y)];
buffer[x + (width * y)] = buffer[x + (width * (height - 1 - y))];
buffer[x + (width * (height - 1 - y))] = temp;
}
}
texture.SetPixels32(buffer);
texture.Apply();
}
}
finally
{
bufferHandle.Free();
}
return texture;
}
}
return null;
}
开发者ID:TamaHobbit,项目名称:DMV,代码行数:48,代码来源:Utils.cs
示例6: DownloadLeaderboardEntriesForUsers
/// <summary>
/// Invokes LeaderboardScoresDownloaded
/// </summary>
/// <param name="handle"></param>
/// <param name="users"></param>
public void DownloadLeaderboardEntriesForUsers(LeaderboardHandle handle, SteamID[] users)
{
CheckIfUsable();
// We need to first convert the array of SteamID objects to a byte array
byte[] rawData = NativeBuffer.ToBytes(users);
using (NativeBuffer buffer = new NativeBuffer(rawData))
{
// Copies the list of user ID's to unmanaged memory
buffer.WriteToUnmanagedMemory();
NativeMethods.Stats_DownloadLeaderboardEntriesForUsers(handle.AsUInt64,
buffer.UnmanagedMemory, users.Length);
}
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:20,代码来源:Stats.cs
示例7: RequestUserStats
/// <summary>
/// Invokes UserStatsReceived
/// </summary>
/// <param name="steamID"></param>
public void RequestUserStats(SteamID steamID)
{
CheckIfUsable();
NativeMethods.Stats_RequestUserStats(steamID.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:9,代码来源:Stats.cs
示例8: HandleLogOnResponse
void HandleLogOnResponse( IPacketMsg packetMsg )
{
if ( !packetMsg.IsProto )
{
DebugLog.WriteLine( "CMClient", "Got non-proto logon response, this is indicative of no logon attempt after connecting." );
return;
}
var logonResp = new ClientMsgProtobuf<CMsgClientLogonResponse>( packetMsg );
if ( logonResp.Body.eresult == ( int )EResult.OK )
{
SessionID = logonResp.ProtoHeader.client_sessionid;
SteamID = logonResp.ProtoHeader.steamid;
int hbDelay = logonResp.Body.out_of_game_heartbeat_seconds;
// restart heartbeat
heartBeatFunc.Stop();
heartBeatFunc.Delay = TimeSpan.FromSeconds( hbDelay );
heartBeatFunc.Start();
}
}
开发者ID:wheybags,项目名称:steamirc,代码行数:23,代码来源:CMClient.cs
示例9: SetLobbyJoinable
public bool SetLobbyJoinable(SteamID steamIDLobby, bool lobbyJoinable)
{
CheckIfUsable();
return NativeMethods.MatchMaking_SetLobbyJoinable(steamIDLobby.AsUInt64, lobbyJoinable);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:MatchMaking.cs
示例10: UserHasLicenseForApp
public UserHasLicenseForAppResult UserHasLicenseForApp(SteamID steamID, AppID appID)
{
//CheckIfUsable();
int tempreturn = NativeMethods.GameServer_UserHasLicenseForApp(steamID.AsUInt64, appID.AsUInt32);
return (UserHasLicenseForAppResult)tempreturn;
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:6,代码来源:GameServer.cs
示例11: AssociateWithClan
public void AssociateWithClan(SteamID steamIDClan)
{
//CheckIfUsable();
NativeMethods.GameServer_AssociateWithClan(steamIDClan.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:GameServer.cs
示例12: SendUserDisconnect
public void SendUserDisconnect(SteamID steamIDUser)
{
//CheckIfUsable();
NativeMethods.GameServer_SendUserDisconnect(steamIDUser.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:GameServer.cs
示例13: BeginAuthSession
public BeginAuthSessionResult BeginAuthSession(System.IntPtr authTicket, int cbAuthTicket, SteamID steamID)
{
//CheckIfUsable();
return (BeginAuthSessionResult)NativeMethods.GameServer_BeginAuthSession(authTicket, cbAuthTicket, steamID.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:GameServer.cs
示例14: GetUserConfig
public JKAConfig GetUserConfig(SteamID id)
{
if (configCache.ContainsKey(id))
{
return configCache[id];
}
return JKAConfig.FromSteamID(id, folderPrefix);
}
开发者ID:Avygeil,项目名称:JKASteamBot,代码行数:9,代码来源:JKAConfigManager.cs
示例15: RequestLobbyData
public bool RequestLobbyData(SteamID steamIDLobby)
{
CheckIfUsable();
return NativeMethods.MatchMaking_RequestLobbyData(steamIDLobby.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:MatchMaking.cs
示例16: SetLinkedLobby
public bool SetLinkedLobby(SteamID steamIDLobby, SteamID steamIDLobbyDependent)
{
CheckIfUsable();
return NativeMethods.MatchMaking_SetLobbyOwner(steamIDLobby.AsUInt64, steamIDLobbyDependent.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:MatchMaking.cs
示例17: SetLobbyOwner
public bool SetLobbyOwner(SteamID steamIDLobby, SteamID steamIDNewOwner)
{
CheckIfUsable();
return NativeMethods.MatchMaking_SetLobbyOwner(steamIDLobby.AsUInt64, steamIDNewOwner.AsUInt64);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:MatchMaking.cs
示例18: GetLobbyOwner
public SteamID GetLobbyOwner(SteamID steamIDLobby)
{
CheckIfUsable();
return new SteamID(NativeMethods.MatchMaking_GetLobbyOwner(steamIDLobby.AsUInt64));
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:5,代码来源:MatchMaking.cs
示例19: SendUserConnectAndAuthenticate
public bool SendUserConnectAndAuthenticate(uint ipClient, byte[] authenticationBlob, out SteamID steamIDUser)
{
//CheckIfUsable();
using (NativeBuffer blobBuffer = new NativeBuffer(authenticationBlob))
{
blobBuffer.WriteToUnmanagedMemory();
ulong rawCreator = 0;
bool result = NativeMethods.GameServer_SendUserConnectAndAuthenticate(ipClient,
blobBuffer.UnmanagedMemory, (uint)blobBuffer.UnmanagedMemory, ref rawCreator);
steamIDUser = new SteamID(rawCreator);
return result;
}
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:17,代码来源:GameServer.cs
示例20: GetUserStat
public bool GetUserStat(SteamID steamID, string name, out float data)
{
CheckIfUsable();
data = 0;
return NativeMethods.Stats_GetUserStatFloat(steamID.AsUInt64, name, ref data);
}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:6,代码来源:Stats.cs
注:本文中的SteamID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论