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


C# Net.Player类代码示例

本文整理汇总了C#中System.Net.Player的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Player类属于System.Net命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoteGameController

 //public Player Player
 //{
 //    get { return player; }
 //    set { player = value; }
 //}
 public RemoteGameController(Player player, ClientSide clientSide, UDPClientServerCommons.Packets.GameInfoPacket gameInfo)
 {
     gameStatus = GameStatus.WaitingForStart;
     clientNetworkLayer = clientSide;
     this.player = player;
     this.gameInfo = gameInfo;
 }
开发者ID:kensniper,项目名称:castle-butcher,代码行数:12,代码来源:RemoteGameController.cs

示例2: Help

 public override void Help(Player p)
 {
     p.SendMessage("/cd - Command shortcut.");
     p.SendMessage("/countdown join - join the game");
     p.SendMessage("/countdown leave - leave the game");
     p.SendMessage("/countdown goto - goto the countdown map");
     p.SendMessage("/countdown players - view players currently playing");
     {
         if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 1))
         {
             p.SendMessage("/countdown rules <send> <all/map/player> - the rules of countdown. with send: all to send to all, map to send to map and have a players name to send to a player");
         }
         else
         {
             p.SendMessage("/countdown rules - view the rules of countdown");
         }
         if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 2))
         {
             p.SendMessage("/countdown download - download the countdown map");
             p.SendMessage("/countdown enable - enable the game");
             p.SendMessage("/countdown disable - disable the game");
             p.SendMessage("/countdown cancel - cancels a game");
             p.SendMessage("/countdown start [speed] [mode] - start the game, speeds are 'slow', 'normal', 'fast', 'extreme' and 'ultimate', modes are 'normal' and 'freeze'");
             p.SendMessage("/countdown reset [all/map] - reset the whole game (all) or only the map (map)");
             p.SendMessage("/countdown tutorial - a tutorial on how to setup countdown");
         }
     }
 }
开发者ID:Goodlyay,项目名称:MCForge-Vanilla-Redux,代码行数:28,代码来源:CmdCountdown.cs

示例3: MultiplayerChatRoom

 public MultiplayerChatRoom(String Name, String IP)
 {
     InitializeComponent();
     players.Add(player = new Player(Name));
     dataGrid.ItemsSource = players;
     StartClient(IP);
 }
开发者ID:KrzysztofUrbanczyk,项目名称:LastTry,代码行数:7,代码来源:MultiplayerChatRoom.xaml.cs

示例4: Use

        public override void Use(Player p, params string[] args)
        {
            int port = 25565;

            if (args.Length == 0)
            {
                if (!p.IsConsole) p.SendMessage("Checking port....");
                else Logger.Log("Checking Port...");
                checkport(25565, p);
            }
            else if (args.Length == 1)
            {
                try
                {
                    port = Convert.ToInt32(args[0]);
                    if (!p.IsConsole) p.SendMessage("Checking port....");
                    else Logger.Log("Checking Port...");
                    checkport(port, p);
                }
                catch (Exception)
                {
                    if (!p.IsConsole) p.SendMessage("port must be a number");
                    else Logger.Log("Port must be a number");
                }
            }
        }
开发者ID:Defuseninja,项目名称:ForgeCraft,代码行数:26,代码来源:CmdCheckPort.cs

示例5: Use

        public override void Use(Player p, string message)
        {
            if (p == null) { Player.SendMessage(p, "This command can only be used in-game!"); return; }
            if (!Directory.Exists("extra/copy"))
                Directory.CreateDirectory("extra/copy");

            if (!File.Exists("extra/copy/nyancat.copy"))
            {
                Player.SendMessage(p, "Nyan Cat copy doesn't exist. Downloading...");
                try
                {
                    using (WebClient WEB = new WebClient())
                        WEB.DownloadFile("http://mcforge.net/uploads/copy/nyancat.copy", "extra/copy/nyancat.copy");
                    }
                    catch
                    {
                        Player.SendMessage(p, "Sorry, downloading failed. Please try again later.");
                        return;
                    }
                }
                Command.all.Find("retrieve").Use(p, "nyancat");
                Command.all.Find("paste").Use(p, "");
                ushort[] loc = p.getLoc(false);
                Command.all.Find("click").Use(p, loc[0] + " " + loc[1] + " " + loc[2]);
        }
开发者ID:Cazzar,项目名称:MCForge-MCLawl,代码行数:25,代码来源:CmdNyan.cs

示例6: Use

        public override void Use(Player p, string message)
        {
            if (!Directory.Exists("extra/passwords"))
                Directory.CreateDirectory("extra/passwords");
            if ( p.group.Permission < Server.verifyadminsrank ) {
                Player.SendMessage(p, "You do not have the &crequired rank " + Server.DefaultColor + "to use this command!");
                return;
            }
            if ( !Server.verifyadmins ) {
                Player.SendMessage(p, "Verification of admins is &cdisabled!");
                return;
            }
            if ( p.adminpen ) {
                if ( File.Exists("extra/passwords/" + p.name + ".dat") ) {
                    Player.SendMessage(p, "&cYou already have a password set. " + Server.DefaultColor + "You &ccannot change " + Server.DefaultColor + "it unless &cyou verify it with &a/pass [Password]. " + Server.DefaultColor + "If you have &cforgotten " + Server.DefaultColor + "your password, contact &c" + Server.server_owner + Server.DefaultColor + " and they can &creset it!");
                    return;
                }
            }
            if ( String.IsNullOrEmpty(message.Trim()) ) {
                Help(p);
                return;

            }
            int number = message.Split(' ').Length;
            if ( number > 1 ) {
                Player.SendMessage(p, "Your password must be one word!");
                return;
            }
            PasswordHasher.StoreHash(p.name, message);
            Player.SendMessage(p, "Your password has &asuccessfully &abeen set to:");
            Player.SendMessage(p, "&c" + message);
        }
开发者ID:B00mX0r,项目名称:MCForge-MCLawl,代码行数:32,代码来源:CmdSetPass.cs

示例7: addGoalieFromPlayer

        public void addGoalieFromPlayer(Player myPlayer)
        {
            Goalie myGoalie = null;
            
            //ensure the current player is removed from the list
            for (int i = 0; i < players.Count; i++)
            {
                if (players[i].Equals(myPlayer))
                {
                    //if there is a player object matching the given player

                    //if that player is a goalie
                    if (players[i].GetType().ToString().Equals("icehockeyWA.Models.Goalie"))
                    {
                        //set the current goalie to that player
                        myGoalie = (Goalie)players[i];
                    }
                    else
                    {
                        players.RemoveAt(i);
                        //create a new goalie object in the list
                        myGoalie = new Goalie(myPlayer.playerID, myPlayer.name, myPlayer.number);
                        players.Add(myGoalie);
                    }
                }
            }

            currentGoalie = myGoalie;
        }
开发者ID:KerrN,项目名称:IceHockeyTeam,代码行数:29,代码来源:Team.cs

示例8: DoAttack

        private void DoAttack(Player attacker, Player attacked)
        {
            List<CardModel> revealed = attacked.DrawCards(2);
            if (revealed.Count > 0)
            {
                string cards = Log.FormatSortedCards(revealed);

                string target = attacked == attacker ? "You" : attacked.Name;
                int choice = attacker.Chooser.ChooseOneEffect(attacker == attacked ? EffectChoiceType.DiscardOrPutOnDeckToDraw: EffectChoiceType.ForceDiscardOrPutOnDeck, revealed, target + " revealed " + cards, choices, choices);
                if (choice == 0)
                {
                    IEnumerable<CardModel> order = attacked.Chooser.ChooseOrder(CardOrderType.OrderOnDeck, "Put " + cards + " back in any order", revealed);
                    foreach (CardModel c in order)
                    {
                        attacked.Deck.PlaceOnTop(c);
                    }
                }
                else
                {
                    foreach (CardModel c in revealed)
                    {
                        attacked.DiscardCard(c);
                    }
                }
            }
        }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:26,代码来源:Oracle.cs

示例9: DoAttack

        private void DoAttack(Player attacker, Player attacked)
        {
            List<CardModel> cards = attacked.DrawCards(2);

            bool hadTreasure = cards.Any(c => c.Is(CardType.Treasure));
            IEnumerable<CardModel> gainable = cards.Where(c => c is Silver || c is Gold);

            if (gainable.Any())
            {
                CardModel treasure = attacker.Chooser.ChooseOneCard(CardChoiceType.TrashForNobleBrigand, "Trash a treasure", ChoiceSource.None, gainable);
                if (treasure != null)
                {
                    attacked.Trash(treasure);
                    attacker.GainCard(treasure, null);
                    cards.Remove(treasure);
                }
            }

            foreach (CardModel other in cards)
            {
                attacked.DiscardCard(other);
            }

            if (!hadTreasure)
            {
                attacked.GainCard(typeof(Copper));
            }
        }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:28,代码来源:NobleBrigand.cs

示例10: AddPlayerFlagAndName

        public static void AddPlayerFlagAndName(ScrollItemWidget template, Player player)
        {
            var flag = template.Get<ImageWidget>("FLAG");
            flag.GetImageCollection = () => "flags";
            if (player.World.RenderPlayer != null && player.World.RenderPlayer.Stances[player] != Stance.Ally)
                flag.GetImageName = () => player.DisplayFaction.InternalName;
            else
                flag.GetImageName = () => player.Faction.InternalName;

            var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
            var playerName = template.Get<LabelWidget>("PLAYER");
            var playerNameFont = Game.Renderer.Fonts[playerName.Font];
            var suffixLength = new CachedTransform<string, int>(s => playerNameFont.Measure(s).X);
            var name = new CachedTransform<Pair<string, int>, string>(c =>
                WidgetUtils.TruncateText(c.First, playerName.Bounds.Width - c.Second, playerNameFont));

            playerName.GetText = () =>
            {
                var suffix = player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")";
                if (client != null && client.State == Session.ClientState.Disconnected)
                    suffix = " (Gone)";

                var sl = suffixLength.Update(suffix);
                return name.Update(Pair.New(player.PlayerName, sl)) + suffix;
            };

            playerName.GetColor = () => player.Color.RGB;
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:28,代码来源:LobbyUtils.cs

示例11: Start

 public void Start(Player player, TcpClient inClientSocket)
 {
     IsRunning = true;
     Player = player;
     clientSocket = inClientSocket;
     Thread ctThread = new Thread(Listen);
     ctThread.Start();
 }
开发者ID:ThomasJackDalby,项目名称:fluffy-octo-giggle,代码行数:8,代码来源:ServerMananager.cs

示例12: Use

        public override void Use(Player p, string message)
        {
            if ( p.group.Permission < Server.verifyadminsrank ) {
                Player.SendMessage(p, "You do not have the &crequired rank to use this command!");
                return;
            }

            if ( !Server.verifyadmins ) {
                Player.SendMessage(p, "Verification of admins is &cdisabled!");
                return;
            }

            if ( !p.adminpen ) {
                Player.SendMessage(p, "You have &calready verified.");
                return;
            }

            if ( p.passtries >= 3 ) {
                p.Kick("Did you really think you could keep on guessing?");
                return;
            }

            if ( String.IsNullOrEmpty(message.Trim()) ) {
                Help(p);
                return;
            }

            int number = message.Split(' ').Length;

            if ( number > 1 ) {
                Player.SendMessage(p, "Your password must be &cone " + Server.DefaultColor + "word!");
                return;
            }

            if ( !Directory.Exists("extra/passwords") ) {
                Player.SendMessage(p, "You have not &cset a password, " + Server.DefaultColor + "use &a/setpass [Password] &cto set one!");
                return;
            }

            DirectoryInfo di = new DirectoryInfo("extra/passwords/");
            FileInfo[] fi = di.GetFiles("*.dat");
            if ( !File.Exists("extra/passwords/" + p.name + ".dat") ) {
                Player.SendMessage(p, "You have not &cset a password, " + Server.DefaultColor + "use &a/setpass [Password] &cto set one!");
                return;
            }

            if ( PasswordHasher.MatchesPass(p.name, message) ) {
                Player.SendMessage(p, "Thank you, " + p.color + p.name + Server.DefaultColor + "! You have now &averified " + Server.DefaultColor + "and have &aaccess to admin commands and features!");
                if ( p.adminpen ) {
                    p.adminpen = false;
                }
                return;
            }

            p.passtries++;
            Player.SendMessage(p, "&cWrong Password. " + Server.DefaultColor + "Remember your password is &ccase sensitive!");
            Player.SendMessage(p, "Forgot your password? " + Server.DefaultColor + "Contact the owner so they can reset it!");
        }
开发者ID:Arrem,项目名称:MCForge-MCLawl,代码行数:58,代码来源:CmdPass.cs

示例13: Blockchange1

 public void Blockchange1(Player p, ushort x, ushort y, ushort z, ushort type)
 {
     p.ClearBlockchange();
     ushort b = p.level.GetTile(x, y, z);
     p.SendBlockchange(x, y, z, b);
     CatchPos bp = (CatchPos)p.blockchangeObject;
     bp.x = x; bp.y = y; bp.z = z; p.blockchangeObject = bp;
     p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2);
 }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:9,代码来源:CmdImageprint.cs

示例14: OnGain

 public override void OnGain(GameModel gameModel, Player player)
 {
     foreach (Player otherPlayer in gameModel.Players)
     {
         if (otherPlayer != player)
         {
             this.DoAttack(player, otherPlayer);
         }
     }
 }
开发者ID:alanjg,项目名称:MajorDomo,代码行数:10,代码来源:NobleBrigand.cs

示例15: Help

 public override void Help(Player p)
 {
     Player.SendMessage(p, "%f/report [Player] [Reason] " + Server.DefaultColor + "- Reports the specified player for the reason");
     if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this)) {
         Player.SendMessage(p, "%f/report list " + Server.DefaultColor + "- Checks the reported list!");
         Player.SendMessage(p, "%f/report check [Player] " + Server.DefaultColor + "- View the report on the specified player");
         Player.SendMessage(p, "%f/report delete [Player] " + Server.DefaultColor + "- Delete the report on the specified player");
         Player.SendMessage(p, "%f/report clear " + Server.DefaultColor + "- %c!!!Clears all reports!!!");
     }
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:10,代码来源:CmdReport.cs


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