当前位置: 首页>>代码示例>>C#>>正文


C# ClientInfo类代码示例

本文整理汇总了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;
 }
开发者ID:yas-online,项目名称:Oxide,代码行数:7,代码来源:SevenDaysLivePlayer.cs

示例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));
                 }
             }
         }
     }
 }
开发者ID:dmustanger,项目名称:7dtd-ServerTools,代码行数:25,代码来源:Watchlist.cs

示例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;
    }
开发者ID:ChaseHuegel,项目名称:LLApi-Basic-Implementation,代码行数:31,代码来源:UserManager.cs

示例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));
             }
         }
     }
 }
开发者ID:dmustanger,项目名称:7dtd-ServerTools,代码行数:26,代码来源:AdminChat.cs

示例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);
            }
        }
    }
开发者ID:san90279,项目名称:UK_OAS,代码行数:35,代码来源:MainPage_Flow.aspx.cs

示例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();
 }
开发者ID:Axure,项目名称:Bilibili-Client,代码行数:7,代码来源:SimpleClient.cs

示例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.");
        }
    }
开发者ID:san90279,项目名称:UK_OAS,代码行数:29,代码来源:SingleSignOn.aspx.cs

示例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 );
 }
开发者ID:FreeReign,项目名称:UOMachine,代码行数:7,代码来源:Assembler.cs

示例9: PlayerLogin

 public override void PlayerLogin(ClientInfo _cInfo, string _compatibilityVersion)
 {
     if (ReservedSlots.IsEnabled)
     {
         ReservedSlots.CheckReservedSlot(_cInfo);
     }
 }
开发者ID:dmustanger,项目名称:7dtd-ServerTools,代码行数:7,代码来源:Api.cs

示例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;
        }
    }
开发者ID:san90279,项目名称:UK_OAS,代码行数:31,代码来源:SingleSignOn.cs

示例11: SetLastPMSender

 public static void SetLastPMSender(ClientInfo _sender, ClientInfo _receiver)
 {
     if (senderOfLastPM.ContainsKey (_receiver))
         senderOfLastPM [_receiver] = _sender;
     else
         senderOfLastPM.Add (_receiver, _sender);
 }
开发者ID:Ketchu13,项目名称:7dtd_Commands_Extended,代码行数:7,代码来源:PrivateMassageConnections.cs

示例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);
        }
    }
开发者ID:san90279,项目名称:UK_OAS,代码行数:28,代码来源:FlowEmail.aspx.cs

示例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");
 }
开发者ID:kevinastone,项目名称:ua-parser,代码行数:7,代码来源:DeviceYamlTestCase.cs

示例14: AddClient

 public void AddClient(int id, ClientInfo client)
 {
     lock (this)
     {
         clients[lastClientID] = client;
     }
     Context.Current.UpdateTrayIcon();
 }
开发者ID:chzh,项目名称:xrefresh,代码行数:8,代码来源:Server.cs

示例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);
     }
 }
开发者ID:Ketchu13,项目名称:7dtd_Server-Fixes,代码行数:8,代码来源:PlayerDataStuff.cs


注:本文中的ClientInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。