本文整理汇总了C#中CSteamID类的典型用法代码示例。如果您正苦于以下问题:C# CSteamID类的具体用法?C# CSteamID怎么用?C# CSteamID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSteamID类属于命名空间,在下文中一共展示了CSteamID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetWarnings
public byte GetWarnings(CSteamID id)
{
byte num = 0;
try
{
MySqlConnection mySqlConnection = this.createConnection();
MySqlCommand mySqlCommand = mySqlConnection.CreateCommand();
mySqlCommand.CommandText = string.Concat(new string[] {
"select `warninglevel` from `",
Zaup_Warning.Instance.Configuration.Instance.TableName,
"` where `steamId` = '",
id.ToString(),
"';"
});
mySqlConnection.Open();
object obj = mySqlCommand.ExecuteScalar();
if (obj != null)
{
byte.TryParse(obj.ToString(), out num);
}
mySqlConnection.Close();
}
catch (Exception exception)
{
Logger.LogException(exception);
}
return num;
}
示例2: execute
protected override void execute( CSteamID executorId, string parameter )
{
try
{
var commandSource = executorId == CSteamID.Nil
? EssProvider.ConsoleSource
: UPlayer.From( executorId );
if ( commandSource.IsConsole && Command.AllowedSource == AllowedSource.PLAYER )
{
EssLang.CONSOLE_CANNOT_EXECUTE.SendTo( commandSource );
}
else if ( !commandSource.IsConsole && Command.AllowedSource == AllowedSource.CONSOLE )
{
EssLang.PLAYER_CANNOT_EXECUTE.SendTo( commandSource );
}
else
{
Command.OnExecute( commandSource , new CommandArgs( parameter ) );
}
}
catch ( Exception e )
{
UPlayer.TryGet( executorId, EssLang.COMMAND_ERROR_OCURRED.SendTo );
EssProvider.Logger.LogError( e.ToString() );
}
}
示例3: ClearUser
public void ClearUser(CSteamID id)
{
lock (this._pendingReadBuffers)
{
this._deletionQueue.Enqueue(id);
}
}
示例4: AddUpdateVictimAccount
public void AddUpdateVictimAccount(CSteamID id, decimal bounty, string lastDisplayName)
{
try
{
MySqlConnection connection = CreateConnection();
MySqlCommand command = connection.CreateCommand();
if (CheckExists(id))
{
command.CommandText = "UPDATE `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` SET `bounty` = bounty + (" + bounty + "), `lastDisplayName` = @lastDisplayName, `lastUpdated` = NOW() WHERE `steamId` = '" + id.ToString() + "';";
}
else
{
command.CommandText = "INSERT IGNORE INTO `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` (steamId,bounty,lastDisplayName,lastUpdated) VALUES('" + id.ToString() + "','" + bounty + "',@lastDisplayName,NOW());";
}
command.Parameters.AddWithValue("@lastDisplayName", lastDisplayName);
connection.Open();
IAsyncResult result = command.BeginExecuteNonQuery();
command.EndExecuteNonQuery(result);
connection.Close();
}
catch (Exception ex)
{
Logger.LogException(ex);
}
}
示例5: ActivateGameOverlayToUser
public static void ActivateGameOverlayToUser(string pchDialog, CSteamID steamID)
{
InteropHelp.TestIfAvailableClient();
using (InteropHelp.UTF8StringHandle uTF8StringHandle = new InteropHelp.UTF8StringHandle(pchDialog))
{
NativeMethods.ISteamFriends_ActivateGameOverlayToUser(uTF8StringHandle, steamID);
}
}
示例6: tellToggleHud
//[SteamCall]
public void tellToggleHud(CSteamID steamID, bool visible)
{
if (base.channel.checkServer(steamID))
{
Debug.LogError("CALLED HUD");
this.visible = visible;
}
}
示例7: SetInvitedToGameId
public void SetInvitedToGameId(ulong gameId)
{
CSteamID y = new CSteamID(gameId);
if (y.IsValid() && (CoopLobby.Instance == null || CoopLobby.Instance.Info.LobbyId != y))
{
base.StartCoroutine(this.DelayedInviteReceived(new CoopLobbyInfo(gameId)));
}
}
示例8: ClearInventory
private void ClearInventory(UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer)
{
if (!player.HasPermission ("keepinventory.keep"))
{
return;
}
var playerInventory = player.Inventory;
List<Item> ids = new List<Item> ();
List<Item> clothes = new List<Item> ();
// "Remove "models" of items from player "body""
player.Player.channel.send ("tellSlot", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, ( byte ) 0, ( byte ) 0, new byte[0]);
player.Player.channel.send ("tellSlot", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, ( byte ) 1, ( byte ) 0, new byte[0]);
// Remove items
for (byte page = 0; page < 8; page++)
{
var count = playerInventory.getItemCount (page);
for (byte index = 0; index < count; index++)
{
ids.Add (playerInventory.getItem (page, 0).item);
playerInventory.removeItem (page, 0);
}
}
// Unequip & remove from inventory
player.Player.clothing.askWearBackpack (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearGlasses (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearHat (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearPants (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearMask (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearShirt (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
player.Player.clothing.askWearVest (0, 0, new byte[0], true);
clothes.Add (removeUnequipped (playerInventory));
clothes.AddRange (ids);
deadAdmins.Add (player);
adminItems.Add (player, clothes);
}
示例9: OnPlayerDeath
internal void OnPlayerDeath( UnturnedPlayer player, EDeathCause cause, ELimb limb,
CSteamID murderer )
{
if ( !player.HasPermission( "essentials.command.back" ) )
return;
var displayName = player.DisplayName;
if ( BackDict.ContainsKey( displayName ) )
BackDict.Remove( displayName );
BackDict.Add( displayName, player.Position );
}
示例10: Party
public Party(UnturnedPlayer leader)
{
//create the party's fake steam group
var buffer = new byte[sizeof(ulong)];
random.NextBytes(buffer);
ulong newID = BitConverter.ToUInt64(buffer, 0);
steamGroup = new CSteamID(newID);
claimedIDs.Add(newID);
//set and add the leader
this.leader = leader;
leader.Player.SteamChannel.SteamPlayer.playerID.SteamGroupID = steamGroup;
members.Add(leader);
}
示例11: ClearUser
public void ClearUser(CSteamID user)
{
lock (this._lock)
{
if (this._pendingSendData.ContainsKey(user))
{
Queue<SteamP2PWriter.WriteInformation> item = this._pendingSendData[user];
while (item.Count > 0)
{
this._bufferPool.Enqueue(item.Dequeue().Data);
}
}
}
}
示例12: IsDataAvailable
public bool IsDataAvailable(CSteamID id)
{
bool flag;
lock (this._pendingReadBuffers)
{
if (this._pendingReadBuffers.ContainsKey(id))
{
Queue<SteamP2PReader.ReadResult> item = this._pendingReadBuffers[id];
flag = (item.Count == 0 || item.Peek().Size == 0 ? false : true);
}
else
{
flag = false;
}
}
return flag;
}
示例13: execute
protected override void execute(CSteamID executorID, string parameter)
{
CommandQueue queue = ExecScript.ToQueue(UnturnedFreneticMod.Instance.CommandSystem.System);
MapTag map = new MapTag();
if (executorID == CSteamID.Nil)
{
map.Internal["is_server"] = new BooleanTag(true);
}
else
{
map.Internal["player"] = new PlayerTag(PlayerTool.getSteamPlayer(executorID));
map.Internal["is_server"] = new BooleanTag(false);
}
map.Internal["raw_arguments"] = new TextTag(parameter);
queue.SetVariable("context", map);
queue.CommandStack.Peek().Debug = DebugMode.MINIMAL; // Just in case
queue.Execute();
}
示例14: GetBounty
public decimal GetBounty(CSteamID id)
{
decimal output = 0;
try
{
MySqlConnection connection = CreateConnection();
MySqlCommand command = connection.CreateCommand();
command.CommandText = "SELECT `bounty` FROM `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` WHERE `steamId` = '" + id.ToString() + "';";
connection.Open();
object result = command.ExecuteScalar();
if (result != null) Decimal.TryParse(result.ToString(), out output);
connection.Close();
}
catch (Exception ex)
{
Logger.LogException(ex);
}
return output;
}
示例15: CheckParameters
private void CheckParameters()
{
ulong ulSteamID;
if (Program.LaunchParameters.ContainsKey("+connect_lobby") && ulong.TryParse(Program.LaunchParameters["+connect_lobby"], out ulSteamID))
{
CSteamID lobbySteamId = new CSteamID(ulSteamID);
if (lobbySteamId.IsValid())
{
Main.OpenPlayerSelect(delegate(PlayerFileData playerData)
{
Main.ServerSideCharacter = false;
playerData.SetAsActive();
Main.menuMode = 882;
Main.statusText = "Joining...";
this._lobby.Join(lobbySteamId, new CallResult<LobbyEnter_t>.APIDispatchDelegate(this.OnLobbyEntered));
});
}
}
}