本文整理汇总了C#中CSteamID类的典型用法代码示例。如果您正苦于以下问题:C# CSteamID类的具体用法?C# CSteamID怎么用?C# CSteamID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSteamID类属于命名空间,在下文中一共展示了CSteamID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:ClassyDestroyer,项目名称:Zaup_Warning,代码行数:28,代码来源:DatabaseMgr.cs
示例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() );
}
}
开发者ID:gitter-badger,项目名称:uEssentials,代码行数:28,代码来源:CommandAdapter.cs
示例3: ClearUser
public void ClearUser(CSteamID id)
{
lock (this._pendingReadBuffers)
{
this._deletionQueue.Enqueue(id);
}
}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:7,代码来源:SteamP2PReader.cs
示例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);
}
}
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:25,代码来源:FeexHitmanDatabase.cs
示例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);
}
}
开发者ID:GameDiffs,项目名称:TheForest,代码行数:8,代码来源:SteamFriends.cs
示例6: tellToggleHud
//[SteamCall]
public void tellToggleHud(CSteamID steamID, bool visible)
{
if (base.channel.checkServer(steamID))
{
Debug.LogError("CALLED HUD");
this.visible = visible;
}
}
开发者ID:RocketMod,项目名称:Rocket.Unturned,代码行数:9,代码来源:HUD.cs
示例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)));
}
}
开发者ID:GameDiffs,项目名称:TheForest,代码行数:8,代码来源:AutoJoinAfterMPInvite.cs
示例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);
}
开发者ID:FaizanDurrani,项目名称:KeepInventory,代码行数:52,代码来源:Main.cs
示例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 );
}
开发者ID:gitter-badger,项目名称:uEssentials,代码行数:13,代码来源:CommandBack.cs
示例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);
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:14,代码来源:Party.cs
示例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);
}
}
}
}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:14,代码来源:SteamP2PWriter.cs
示例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;
}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:17,代码来源:SteamP2PReader.cs
示例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();
}
开发者ID:FreneticXYZ,项目名称:UnturnedFrenetic,代码行数:18,代码来源:UnturnedCustomCommand.cs
示例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;
}
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:19,代码来源:FeexHitmanDatabase.cs
示例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));
});
}
}
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:19,代码来源:NetClientSocialModule.cs
示例16: Receive
public int Receive(CSteamID user, byte[] buffer, int bufferOffset, int bufferSize)
{
int num;
uint num1 = 0;
lock (this._pendingReadBuffers)
{
if (this._pendingReadBuffers.ContainsKey(user))
{
Queue<SteamP2PReader.ReadResult> item = this._pendingReadBuffers[user];
while (item.Count > 0)
{
SteamP2PReader.ReadResult readResult = item.Peek();
uint num2 = (uint)Math.Min(bufferSize - num1, readResult.Size - readResult.Offset);
if (num2 != 0)
{
Array.Copy(readResult.Data, (long)readResult.Offset, buffer, (long)((long)bufferOffset + (long)num1), (long)num2);
if (num2 != readResult.Size - readResult.Offset)
{
SteamP2PReader.ReadResult offset = readResult;
offset.Offset = offset.Offset + num2;
}
else
{
this._bufferPool.Enqueue(item.Dequeue().Data);
}
num1 = num1 + num2;
}
else
{
num = (int)num1;
return num;
}
}
return (int)num1;
}
else
{
num = 0;
}
}
return num;
}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:42,代码来源:SteamP2PReader.cs
示例17: QueueSend
public void QueueSend(CSteamID user, byte[] data, int length)
{
lock (this._lock)
{
Queue<SteamP2PWriter.WriteInformation> queue;
if (this._pendingSendData.ContainsKey(user))
{
queue = this._pendingSendData[user];
}
else
{
queue = (this._pendingSendData[user] = new Queue<SteamP2PWriter.WriteInformation>());
}
int i = length;
int num = 0;
while (i > 0)
{
SteamP2PWriter.WriteInformation writeInformation;
if (queue.Count == 0 || 1024 - queue.Peek().Size == 0)
{
if (this._bufferPool.Count > 0)
{
writeInformation = new SteamP2PWriter.WriteInformation(this._bufferPool.Dequeue());
}
else
{
writeInformation = new SteamP2PWriter.WriteInformation();
}
queue.Enqueue(writeInformation);
}
else
{
writeInformation = queue.Peek();
}
int num2 = Math.Min(i, 1024 - writeInformation.Size);
Array.Copy(data, num, writeInformation.Data, writeInformation.Size, num2);
writeInformation.Size += num2;
i -= num2;
num += num2;
}
}
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:42,代码来源:SteamP2PWriter.cs
示例18: TriggerReceive
internal static void TriggerReceive(SteamChannel instance, CSteamID d, byte[] a, int b,int size)
{
#if DEBUG
/*ESteamPacket eSteamPacket = (ESteamPacket)a[0];
int num = a[1];
if (eSteamPacket != ESteamPacket.UPDATE_VOICE && eSteamPacket != ESteamPacket.UPDATE_UDP_CHUNK && eSteamPacket != ESteamPacket.UPDATE_TCP_CHUNK)
{
object[] objects = SteamPacker.getObjects(d, 2, a, instance.Methods[num].Types);
string o = "";
foreach (object r in objects)
{
o += r.ToString() + ",";
}
Logger.Log("Receive+" + d.ToString() + ": " + o + " - " + b);
}*/
#endif
return;
}
开发者ID:RocketMod,项目名称:Rocket.Unturned,代码行数:20,代码来源:UnturnedPlayerEvents.cs
示例19: QueueSend
public void QueueSend(CSteamID user, byte[] data, int length)
{
Queue<SteamP2PWriter.WriteInformation> item;
SteamP2PWriter.WriteInformation writeInformation;
lock (this._lock)
{
if (!this._pendingSendData.ContainsKey(user))
{
Dictionary<CSteamID, Queue<SteamP2PWriter.WriteInformation>> cSteamIDs = this._pendingSendData;
Queue<SteamP2PWriter.WriteInformation> writeInformations = new Queue<SteamP2PWriter.WriteInformation>();
item = writeInformations;
cSteamIDs[user] = writeInformations;
}
else
{
item = this._pendingSendData[user];
}
int num = length;
int num1 = 0;
while (num > 0)
{
if (item.Count == 0 || 1024 - item.Peek().Size == 0)
{
writeInformation = (this._bufferPool.Count <= 0 ? new SteamP2PWriter.WriteInformation() : new SteamP2PWriter.WriteInformation(this._bufferPool.Dequeue()));
item.Enqueue(writeInformation);
}
else
{
writeInformation = item.Peek();
}
int num2 = Math.Min(num, 1024 - writeInformation.Size);
Array.Copy(data, num1, writeInformation.Data, writeInformation.Size, num2);
SteamP2PWriter.WriteInformation size = writeInformation;
size.Size = size.Size + num2;
num = num - num2;
num1 = num1 + num2;
}
}
}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:39,代码来源:SteamP2PWriter.cs
示例20: CheckAccount
public bool CheckAccount(CSteamID id)
{
try
{
MySqlConnection connection = CreateConnection();
MySqlCommand command = connection.CreateCommand();
int exists = 0;
connection.Open();
command.CommandText = "SELECT COUNT(1) FROM `" + FeexRanks.Instance.Configuration.Instance.FeexRanksDatabase.DatabaseTableName + "` WHERE `steamId` = '" + id.ToString() + "'";
object result = command.ExecuteScalar();
if (result != null) Int32.TryParse(result.ToString(), out exists);
connection.Close();
if (exists == 0) { return false; }
else { return true; }
}
catch (Exception ex)
{
Logger.LogException(ex);
return false;
}
}
开发者ID:jorea143,项目名称:FeexRanks,代码行数:22,代码来源:FeexRanksDatabase.cs
注:本文中的CSteamID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论