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


C# Net类代码示例

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


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

示例1: HandlePacketPong

 public static void HandlePacketPong(Client client, Net.Paket.PongPaket pp)
 {
     if(pp.Message == Settings.Default.ServerName)
     {
         client._nextActivityCheck = DateTime.Now + TimeSpan.FromSeconds(30);
     }
 }
开发者ID:Promichel,项目名称:IrcSharp,代码行数:7,代码来源:Client.Recv.cs

示例2: GetAnalyzer

 protected override Analyzer GetAnalyzer(Net.Util.Version version)
 {
     var a = new PerFieldAnalyzerWrapper(base.GetAnalyzer(version));
     a.AddAnalyzer("Version", new KeywordAnalyzer());
     a.AddAnalyzer("Flag", new KeywordAnalyzer());
     return a;
 }
开发者ID:dpvreony-forks,项目名称:Lucene.Net.Linq,代码行数:7,代码来源:OrderByTests.cs

示例3: Main

    public static void Main(string[] args)
    {
        QApplication.initialize(args);

        // Parse any command-line arguments we're interested in.
        // For now, we just assume all arguments are hostnames
        // or IP addresses of peers we want to connect to.
        // This might change if/when we need more interesting options.
        ushort port = 0;	// 0 means system-chosen port (default)
        foreach (string arg in args) {
            if (arg.StartsWith("-port:")) {
                port = UInt16.Parse(arg.Substring(6));
            } else if (arg.StartsWith("-")) {
                Console.WriteLine(
                    "Unknown command-line option" + arg);
            } else	// Interpret the argument as a peer name.
                initPeers.Add(arg);
        }

        // Create the Net object implementing our network protocol
        // and our peer-to-peer system state model.
        Net net = new Net(port, initPeers);

        // Create and show the main GUI window
        // The Gui object can "see" the Net object but not vice versa.
        // This is intentional: we want to keep Net independent of Gui,
        // so that (for example) we can run a non-graphical instance
        // of our peer-to-peer system controlled some other way,
        // e.g., as a daemon or via command-line or Web-based control.
        Gui gui = new Gui(net);
        gui.show();

        QApplication.exec();
    }
开发者ID:jyale,项目名称:group-chat,代码行数:34,代码来源:main.cs

示例4: GetAnalyzer

 protected override Analyzer GetAnalyzer(Net.Util.Version version)
 {
     var analyzer = new PerFieldAnalyzerWrapper(base.GetAnalyzer(version));
     analyzer.AddAnalyzer("Path", new CaseInsensitiveKeywordAnalyzer());
     analyzer.AddAnalyzer("Key", new KeywordAnalyzer());
     return analyzer;
 }
开发者ID:Zaixu,项目名称:Lucene.Net.Linq,代码行数:7,代码来源:AllowSpecialCharactersTests.cs

示例5: OnTargeted

        public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message)
        {
            World.BroadcastIfRevealed(new PlayAnimationMessage
            {
                ActorID = this.DynamicID,
                Field1 = 5,
                Field2 = 0,
                tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[]
                {
                    new Net.GS.Message.Fields.PlayAnimationMessageSpec()
                    {
                        Duration = 50,
                        AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening],
                        PermutationIndex = 0,
                        Speed = 1
                    }
                }

            }, this);

            World.BroadcastIfRevealed(new SetIdleAnimationMessage
            {
                ActorID = this.DynamicID,
                AnimationSNO = AnimationSetKeys.Open.ID
            }, this);

            this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
            this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
            this.Attributes[GameAttribute.Gizmo_State] = 1;
            Attributes.BroadcastChangedIfRevealed();

            base.OnTargeted(player, message);
        }
开发者ID:vrobel,项目名称:mooege,代码行数:33,代码来源:Door.cs

示例6: RemovePlayerFromGame

        public static void RemovePlayerFromGame(Net.GS.GameClient gameClient)
        {
            if (gameClient == null || gameClient.Game == null) return;

            var gameId = gameClient.Game.GameId;
            if (!Games.ContainsKey(gameId)) return;

            var game = Games[gameId];
            if (!game.Players.ContainsKey(gameClient)) return;

            Player p = null;
            if (!game.Players.TryRemove(gameClient, out p))
            {
                Logger.Error("Can't remove player ({0}) from game with id: {1}", gameClient.Player.Toon.Name, gameId);
            }

            if (p != null)
            {
                var toon = p.Toon;
                toon.TimePlayed += DateTimeExtensions.ToUnixTime(DateTime.UtcNow) - toon.LoginTime;
                toon.SaveToDB();

                // Remove Player From World
                if (p.InGameClient != null)
                    p.World.Leave(p);
            }

            if (game.Players.Count == 0)
            {
                Games.Remove(gameId); // we should be also disposing it /raist.
            }
        }
开发者ID:spookywizz,项目名称:mooege,代码行数:32,代码来源:GameManager.cs

示例7: GetAnalyzer

 protected override Analyzer GetAnalyzer(Net.Util.Version version)
 {
     analyzer = new PerFieldAnalyzerWrapper(base.GetAnalyzer(version));
     analyzer.AddAnalyzer<SampleDocument>(t => t.Id, new KeywordAnalyzer());
     analyzer.AddAnalyzer<SampleDocument>(t => t.Key, new CaseInsensitiveKeywordAnalyzer());
     return analyzer;
 }
开发者ID:Zaixu,项目名称:Lucene.Net.Linq,代码行数:7,代码来源:SelectTests.cs

示例8: OnTargeted

        public override void OnTargeted(Player player, Net.GS.Message.Definitions.World.TargetMessage message)
        {
            var world = player.World;

            world.BroadcastIfRevealed(new PlayAnimationMessage()
            {
                ActorID = this.DynamicID,
                Field1 = 5,
                Field2 = 0f,
                tAnim = new[]
                    {
                        new PlayAnimationMessageSpec()
                        {
                            Duration = 4,
                            AnimationSNO = 0x2f761,
                            PermutationIndex = 0,
                            Speed = 1f,
                        }
                    }
            }, this);

            player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenWaypointSelectionWindowMessage)
            {
                ActorID = this.DynamicID
            });
        }
开发者ID:ralje,项目名称:mooege,代码行数:26,代码来源:Waypoint.cs

示例9: handleMsg

 public override void handleMsg(Net.Message msg)
 {
     EventArgs e = new EventArgs();
     switch (msg.head)
     {
         case "in":
             join(client);
             msg.data = client.loginName + " is in";
             break;
         case "talk":
             string content = msg.data;
             msg.data = client.loginName + " : " + content;
             break;
         case "exit":
             msg.data = client.loginName + " is out";
             break;
         default:
             addText(e, "client trigger a undefined event!");
             break;
     }
     for (int i = 0; i < roomChatter.Count; i++)
     {
         roomChatter[i].sw.Write(serializeStream(msg));
         roomChatter[i].sw.Flush();
         //AddItemToListBox("To " + user.loginName + ":" + message);
     }
 }
开发者ID:Like-Jean,项目名称:ChatApplication,代码行数:27,代码来源:ServerChatRoom.cs

示例10: OnTargeted

        public override void OnTargeted(Player player, Net.GS.Message.Definitions.World.TargetMessage message)
        {
            var world = player.World;

            world.BroadcastIfRevealed(new PlayAnimationMessage()
            {
                ActorID = this.DynamicID,
                Field1 = 5,
                Field2 = 0f,
                tAnim = new[]
                    {
                        new PlayAnimationMessageSpec()
                        {
                            Duration = 4,
                            AnimationSNO = 0x2f761,
                            PermutationIndex = 0,
                            Speed = 1f,
                        }
                    }
            }, this);

            player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenWaypointSelectionWindowMessage)
            {
                ActorID = this.DynamicID
            });

            //erekose we set the flag for "operated"
            this.Attributes[Net.GS.Message.GameAttribute.Gizmo_Has_Been_Operated] = true;

        }
开发者ID:erekos3,项目名称:mooege,代码行数:30,代码来源:Waypoint.cs

示例11: NNBasicStrategy

 public NNBasicStrategy(Net.Net net, double eps = .9, double lambda = .5)
 {
     this.net = net;
     this.eps = eps;
     this.lambda = .5;
     r = new Random();
 }
开发者ID:JFerguson20,项目名称:BlackJack,代码行数:7,代码来源:NNBasicStrategy.cs

示例12: OnTargeted

        public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message)
        {
            Logger.Warn("Healthwell has no function, Powers not implemented");

            this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true;
            this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID);
            this.Attributes[GameAttribute.Gizmo_State] = 1;
            Attributes.BroadcastChangedIfRevealed();
        }
开发者ID:n3rus,项目名称:mooege,代码行数:9,代码来源:Healthwell.cs

示例13: Write

	private void Write (String data, Net.IRequestListener requestListener)
	{
		try {
			File.AppendAllText (tracesFile, data);
			requestListener.Result ("");
		} catch (Exception e) {
			requestListener.Error (e.Message);
		}	
	}
开发者ID:gorco,项目名称:LaCortesiaDeEspa-a,代码行数:9,代码来源:LocalStorage.cs

示例14: GetNet

    private Net GetNet()
    {
        if (m_Net == null)
        {
            m_Net = new Net();
        }

        return m_Net;
    }
开发者ID:wuhuichun,项目名称:Frame,代码行数:9,代码来源:Game.cs

示例15: Route

		public async Task<string> Route(ControllerActionParts parts, Net.Api.RequestType requestType)
		{
			var path = parts.OriginalPath;
			path = path.Replace("/", ".");
			//path = path.Replace("-", "_");
			var resourceName = string.Format("Scrutiny.{0}", path);
			var content = await Resources.GetStringAsync(resourceName);
			return content;
		}
开发者ID:aquamoth,项目名称:Scrutiny,代码行数:9,代码来源:FallbackRouter.cs


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