本文整理汇总了C#中ClientInfo类的典型用法代码示例。如果您正苦于以下问题:C# ClientInfo类的具体用法?C# ClientInfo怎么用?C# ClientInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientInfo类属于命名空间,在下文中一共展示了ClientInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SevenDaysLivePlayer
internal SevenDaysLivePlayer(ClientInfo client)
{
this.client = client;
steamId = Convert.ToUInt64(client.playerId);
Character = this;
Object = GameManager.Instance.World.Players.dict[client.entityId].transform.gameObject;
}
示例2: CheckWatchlist
public static void CheckWatchlist(ClientInfo _cInfo)
{
if (Dict.ContainsKey(_cInfo.playerId))
{
List<ClientInfo> _cInfoList = ConnectionManager.Instance.GetClients();
foreach (ClientInfo _cInfo1 in _cInfoList)
{
if (GameManager.Instance.adminTools.IsAdmin(_cInfo1.playerId))
{
string _phrase350;
if (!Phrases.Dict.TryGetValue(350, out _phrase350))
{
_phrase350 = "Player {PlayerName} is on the watchlist for {Reason}.";
}
string _reason = null;
if (Dict.TryGetValue(_cInfo.playerId, out _reason))
{
_phrase350 = _phrase350.Replace("{PlayerName}", _cInfo.playerName);
_phrase350 = _phrase350.Replace("{Reason}", _reason);
_cInfo1.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("[FF8000]{0}[-]", _phrase350), "Server", false, "", false));
}
}
}
}
}
示例3: GetUserByTokenIDSecure
public bool GetUserByTokenIDSecure(string tokenID, int connectionID, out ClientInfo client, out string detailMessage)
{
lock (lockTokenObject)
{
if (!TokenClients.TryGetValue(tokenID, out client))
{
detailMessage = "There is no User with TokenID: " + tokenID;
Debug.LogWarning(detailMessage);
return false;
}
}
ClientInfo clientSecure;
lock (lockConnectedObject)
{
if (!ConnectedClients.TryGetValue(connectionID, out clientSecure))
{
detailMessage = "No Client Connected from: " + client.ConnectionID;
Debug.LogWarning(detailMessage);
return false;
}
}
if (!clientSecure.UserID.Equals(client.UserID))
{
detailMessage = "Client Connected from: " + client.ConnectionID+" is different from TokenID: " + tokenID;
Debug.LogWarning(detailMessage);
return false;
}
detailMessage = "Success";
return true;
}
示例4: SendAdmins
public static void SendAdmins(ClientInfo _sender, string _message)
{
if (!GameManager.Instance.adminTools.IsAdmin(_sender.playerId))
{
string _phrase200;
if (!Phrases.Dict.TryGetValue(200, out _phrase200))
{
_phrase200 = "{PlayerName} you do not have permissions to use this command.";
}
_phrase200 = _phrase200.Replace("{PlayerName}", _sender.playerName);
_sender.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", CustomCommands.ChatColor, _phrase200), "Server", false, "", false));
}
else
{
List<ClientInfo> _cInfoList = ConnectionManager.Instance.GetClients();
foreach (ClientInfo _cInfo in _cInfoList)
{
if (GameManager.Instance.adminTools.IsAdmin(_cInfo.playerId))
{
_message = _message.Replace("@ADMINS ", "");
_message = _message.Replace("@admins ", "");
_cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("[FF0080]{0}[-]", _message), _sender.playerName, false, "", false));
}
}
}
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
String isShowMetro = ConfigurationManager.AppSettings["ShowMetro"];
if (String.IsNullOrEmpty(isShowMetro) || isShowMetro.ToLower() == "false")
{
JQMetro1.Visible = false;
MainImg.Visible = true;
}
else if (isShowMetro.ToLower() == "true")
{
JQMetro1.Visible = true;
MainImg.Visible = false;
}
var key = this.Request.QueryString["key"];
var param = this.Request.QueryString["param"];
if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(param))
{
try
{
var clientInfo = new ClientInfo() { SecurityKey = key, UseDataSet = true };
EFServiceClient client = EFClientTools.ClientUtility.Client;
clientInfo = client.LogOn(clientInfo);
var locale = Request.UserLanguages.Length > 0 ? Request.UserLanguages[0] : "en-us";
clientInfo.Locale = locale;
clientInfo.LogonResult = LogonResult.Logoned;
Session["ClientInfo"] = clientInfo;
parameter.Value = DecryptParameters(param, key);
}
catch
{
Response.Redirect("Timeout.aspx", true);
}
}
}
示例6: Start
void Start()
{
Socket sock = Sockets.CreateTCPSocket("www.myserver.com", 2345);
client = new ClientInfo(sock, false); // Don't start receiving yet
client.OnReadBytes += new ConnectionReadBytes(ReadData);
client.BeginReceive();
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string strFullUrl = Request.Url.ToString();
string url = strFullUrl.Substring(strFullUrl.IndexOf("RedirectUrl") + 12);
var publicKey = this.Request.QueryString["PublicKey"];
if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(publicKey))
{
try
{
var clientInfo = new ClientInfo() { SecurityKey = publicKey, UseDataSet = true };
EFServiceClient client = EFClientTools.ClientUtility.Client;
clientInfo = client.LogOn(clientInfo);
var locale = Request.UserLanguages.Length > 0 ? Request.UserLanguages[0] : "en-us";
clientInfo.Locale = locale;
clientInfo.LogonResult = LogonResult.Logoned;
Session["ClientInfo"] = clientInfo;
Response.Redirect(url);
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
}
else
{
Response.Write("PublishKey is null or url is null.");
}
}
示例8: Execute
public static void Execute( ClientInfo ci, byte param1, byte param2a, byte param2b )
{
ci.PrimaryCave[data1offset + 24] = param1;
ci.PrimaryCave[data1offset + 28] = param2b;
ci.PrimaryCave[data1offset + 29] = param2a;
Memory.Write( ci.Handle, ci.CaveAddress, ci.PrimaryCave, true );
}
示例9: PlayerLogin
public override void PlayerLogin(ClientInfo _cInfo, string _compatibilityVersion)
{
if (ReservedSlots.IsEnabled)
{
ReservedSlots.CheckReservedSlot(_cInfo);
}
}
示例10: LogOn
public string LogOn(string userId, string password, string dataBase, string solution)
{
EFServiceClient client = EFClientTools.ClientUtility.Client;
EFClientTools.ClientUtility.ServerIPAddress = client.GetServerIPAddress();
var ipAddress = HttpContext.Current.Request.UserHostAddress;
var clientInfo = new ClientInfo()
{
UserID = userId,
Password = password,
Database = dataBase,
Solution = solution,
IPAddress = ipAddress,
Locale = "en-us",
UseDataSet = true
};
if(clientInfo.UserID.Contains("'"))
{
return string.Empty;
}
var result = client.LogOn(clientInfo);
client = EFClientTools.ClientUtility.Client;
if (result.LogonResult == LogonResult.Logoned)
{
return result.SecurityKey;
}
else
{
return string.Empty;
}
}
示例11: SetLastPMSender
public static void SetLastPMSender(ClientInfo _sender, ClientInfo _receiver)
{
if (senderOfLastPM.ContainsKey (_receiver))
senderOfLastPM [_receiver] = _sender;
else
senderOfLastPM.Add (_receiver, _sender);
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
var key = this.Request.QueryString["key"];
var param = this.Request.QueryString["param"];
if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(param))
{
try
{
var clientInfo = new ClientInfo() { SecurityKey = key, UseDataSet = true };
EFServiceClient client = EFClientTools.ClientUtility.Client;
clientInfo = client.LogOn(clientInfo);
var locale = Request.UserLanguages.Length > 0 ? Request.UserLanguages[0] : "en-us";
clientInfo.Locale = locale;
clientInfo.LogonResult = LogonResult.Logoned;
Session["ClientInfo"] = clientInfo;
parameter.Value = DecryptParameters(param, key);
}
catch
{
Response.Redirect("Timeout.aspx", true);
}
}
else
{
Response.Redirect("Timeout.aspx", true);
}
}
示例13: Verify
public override void Verify(ClientInfo clientInfo)
{
Assert.NotNull(clientInfo);
AssertMatch(Family,clientInfo.Device.Family,"Family");
AssertMatch(IsMobile, clientInfo.Device.IsMobile, "IsMobile");
AssertMatch(IsSpider, clientInfo.Device.IsSpider, "IsSpider");
}
示例14: AddClient
public void AddClient(int id, ClientInfo client)
{
lock (this)
{
clients[lastClientID] = client;
}
Context.Current.UpdateTrayIcon();
}
示例15: GM_SavePlayerData
public static void GM_SavePlayerData(ClientInfo _cInfo, PlayerDataFile _playerDataFile)
{
try {
PersistentContainer.Instance.Players[_cInfo.playerId, true].Update (_playerDataFile);
} catch (Exception e) {
Log.Out ("Error in GM_SavePlayerData: " + e);
}
}