• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NetSocket类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Awake

        private void Awake() {
            socket = GetComponent<NetSocket>();
            //database = GetComponent<StreamDatabaseServer>();

            socket.RegisterRpcListener(this);
            socket.Events.OnClientDisconnected += EndSession;
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:7,代码来源:LoginServer.cs


示例2: Network

 public Network()
 {
     Contexts = new List<WebSocketContext>();
     Net = new NetSocket(Log.Reporter);
     ReceivedPackets = new List<ReceivedPacket>();
     Users = new Dictionary<WebSocketContext, long>();
 }
开发者ID:oojjrs,项目名称:Nuri4,代码行数:7,代码来源:Network.cs


示例3: FromBin

 public void FromBin(NetSocket.ByteArray bin)
 {
     bin.Get_(out pos.x);
     bin.Get_(out pos.y);
     bin.Get_(out scene_type_idx);
     bin.Get_(out scene_obj_idx);
 }
开发者ID:602147629,项目名称:UnitySocket,代码行数:7,代码来源:scene_def.cs


示例4: FromBin

				public void FromBin (NetSocket.ByteArray bin)
				{
					for (uint i = 0; i < (uint)ECharCityLimit.MAX_CHAR_BIN_CITY_COUNT; ++i) {
						city [i] = new twp.app.unit.CityData ();
						city [i].FromBin (bin);
					}
				}
开发者ID:602147629,项目名称:UnitySocket,代码行数:7,代码来源:char_city_def.cs


示例5: Awake

        void Awake() {
            socket = GetComponent<NetSocket>();

            socket.RegisterRpcListener(this);

            socket.Events.OnFailedToConnect += ConnectionFailed;
            socket.Events.OnConnectedToServer += ConnectedToZone;
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:8,代码来源:NetZoneClient.cs


示例6: FromBin

                public new void FromBin(NetSocket.ByteArray bin)
                {
                    base.FromBin(bin);

                    int result_;bin.Get_(out result_);result = (Result)result_;
                    bin.Get_(out ss_idx);
                    bin.Get_(out char_idx);
                }
开发者ID:602147629,项目名称:UnitySocket,代码行数:8,代码来源:ws2c.cs


示例7: Awake

        private void Awake() {
            Socket = GetComponent<NetSocket>();
            ViewManager = GetComponent<NetViewManager>();

            Socket.RegisterRpcListener(this);
            Socket.Events.OnPeerConnected += PeerConnected;
            Socket.Events.OnPeerDisconnected += PeerDisconnected;
            Socket.Events.OnClientConnected += ClientConnected;
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:9,代码来源:NetZoneServer.cs


示例8: FromBin

 public void FromBin(NetSocket.ByteArray bin)
 {
     bin.Get_ (out quest_flags);
     bin.Get_ (out combat_flags);
     bin.Get_ (out refresh_pub);
     bin.Get_ (out refresh_smith_shop);
     bin.Get_ (out guide_flags);
     bin.Get_ (out role_event_point);
 }
开发者ID:602147629,项目名称:UnitySocket,代码行数:9,代码来源:char_setting_def.cs


示例9: FromBin

 public new void FromBin(NetSocket.ByteArray bin)
 {
     base.FromBin(bin);
     //
     int e_result__;
     bin.Get_(out e_result__);
     e_result = (e_result_) e_result__;
     //
     bin.Get_(out charidx_created);
 }
开发者ID:602147629,项目名称:UnitySocket,代码行数:10,代码来源:ls2c.cs


示例10: FromBin

                public new void FromBin(NetSocket.ByteArray bin)
                {
                    base.FromBin (bin);

                    bin.Get_ (out param);
                    for(uint i = 0; i < yw.YwEncrypt.LIMIT_KEY_LENGTH; ++i)
                    {
                        bin.Get_ (out key[i]);
                    }
                }
开发者ID:602147629,项目名称:UnitySocket,代码行数:10,代码来源:fep2c.cs


示例11: EncryptInfo

    public EncryptInfo(NetSocket.ByteArray bin)
    {
        // 跳过两个字节
        bin.Move (NetSocket.CSocketManager.headerLen);

        bin.Get_ (out param);
        for (uint i = 0; i < yw.YwEncrypt.LIMIT_KEY_LENGTH; ++i) {
            bin.Get_ (out key [i]);
        }
    }
开发者ID:602147629,项目名称:UnitySocket,代码行数:10,代码来源:EncryptInfo.cs


示例12: NetConnection

 internal NetConnection(bool isServer, bool isPeer, NetSocket socket, IPEndPoint endpoint, uint id = 0) {
     IsServer = isServer;
     IsPeer = isPeer;
     Socket = socket;
     Endpoint = endpoint;
     Id = id;
     Unreliable = new NetChannelUnreliable(this);
     Reliable = new NetChannelReliable(this);
     LastReceiveTime = LastSendTime = Created = NetTime.Milliseconds();
     AddToGroup(0);
 }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:11,代码来源:NetConnection.cs


示例13: Awake

    void Awake() {
        socket = GetComponent<NetSocket>();
        database = GetComponent<StreamDatabaseServer>();
        loginServer = GetComponent<LoginServer>();
        viewManager = GetComponent<NetViewManager>();

        loginServer.OnLoginSuccess += LoggedIn;

        socket.RegisterRpcListener(this);
        socket.Events.OnClientDisconnected += ClientDisconnected;
    }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:11,代码来源:PlayerSpawner.cs


示例14: FromBin

                public twp.app.resource.Engineer[] engineer = new twp.app.resource.Engineer[(int)twp.app.city.EAreaDefLimit.LIMIT_MAX_AREA_COUNT]; //工程师

                public void FromBin(NetSocket.ByteArray bin)
                {
                    for (UInt16 i = 0; i < (UInt16)twp.app.city.EAreaDefLimit.LIMIT_MAX_AREA_COUNT; ++i) {
                        resource [i] = new twp.app.resource.Resource ();
                        resource [i].FromBin (bin);
                    }

                    for (UInt16 i = 0; i < (UInt16)twp.app.city.EAreaDefLimit.LIMIT_MAX_AREA_COUNT; ++i) {
                        engineer [i] = new twp.app.resource.Engineer ();
                        engineer [i].FromBin (bin);
                    }
                }
开发者ID:602147629,项目名称:UnitySocket,代码行数:14,代码来源:char_area_resource_def.cs


示例15: FromBin

                public bool is_online; //是否在线

                public void FromBin(NetSocket.ByteArray bin)
                {
                    bin.Get_(out char_idx);
                    char_name = bin.GetStringData((int)twp.app.unit.EUnitLimit.LIMIT_NAME_STR_LENGTH+1);
                    byte v;
                    bin.Get_(out v);
                    relation_type = (RelationType)v;
                    bin.Get_(out battle_integral);
                    sbyte isonline;
                    bin.Get_(out isonline);
                    is_online = (isonline == 0)? false : true;
                }
开发者ID:602147629,项目名称:UnitySocket,代码行数:14,代码来源:relation_def.cs


示例16: Start

        private void Start() {
            socket = GetComponent<NetSocket>();
            viewManager = GetComponent<NetViewManager>();
            zoneClient = GetComponent<NetZoneClient>();

            ExampleItems.PopulateItemDatabase();

            zoneClient.OnZoneSetupSuccess += ZoneSetupSuccessful;

            socket.Events.OnDisconnectedFromServer += DisconnectedFromServer;

            socket.StartSocket();
            socket.RegisterRpcListener(this);
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:14,代码来源:ClientModel.cs


示例17: FromBin

                public byte worker_house; //矮人工匠屋数量

                #endif

                public void FromBin(NetSocket.ByteArray bin)
                {
                    #if false
                    bin.Get_ (out silver);          // 银
                    bin.Get_ (out copper);          // 铜
                    bin.Get_ (out copper_max);  // 铜上限
                    bin.Get_ (out food);            // 粮食
                    bin.Get_ (out food_max);  // 粮食上限
                    bin.Get_ (out population);  // 人口
                    bin.Get_ (out population_max); // 最大人口
                    #else
                    bin.Get_ (out worker_house);
                    #endif
                }
开发者ID:602147629,项目名称:UnitySocket,代码行数:18,代码来源:area_resource_def.cs


示例18: Start

        private void Start() {
            socket = GetComponent<NetSocket>();
            viewManager = GetComponent<NetViewManager>();
            zoneClient = GetComponent<NetZoneClient>();

            zoneClient.OnZoneSetupSuccess += ZoneSetupSuccessful;

            socket.Events.OnDisconnectedFromServer += DisconnectedFromServer;
            socket.Events.OnConnectedToServer += ConnectedToServer;

            socket.StartSocket();
            socket.RegisterRpcListener(this);

            socket.Connect(ServerAddress);
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:15,代码来源:ClientModel.cs


示例19: Awake

        private void Awake() {
            socket = GetComponent<NetSocket>();
            uiManager = GetComponent<UiManager>();

            if (socket == null || uiManager == null) {
                Debug.LogError("Missing required component.");
                return;
            }

            socket.RegisterRpcListener(this);
            socket.Events.OnConnectedToServer += ConnectedToServer;
            socket.Events.OnSocketStart += ConnectToLoginServer;
            socket.Events.OnFailedToConnect += ConnectFailed;
            socket.Events.OnDisconnectedFromServer += DisconnectedFromServer;

            Button.ListenForClick(LoginButtonName, LoginClicked);
            Button.ListenForClick(RegisterButtonName, RegisterClicked);
            TextFieldInput.ListenForSubmit(UsernameInputName, Submit);
            TextFieldInput.ListenForSubmit(PasswordInputName, Submit);
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:20,代码来源:LoginClient.cs


示例20: Start

        private void Start() {
            socket = GetComponent<NetSocket>();
            viewManager = GetComponent<NetViewManager>();
            zoneManager = GetComponent<NetZoneManager>();
            zoneServer = GetComponent<NetZoneServer>();

            zoneServer.OnAssignment += AssignedToZone;

            socket.ProtocolAuthority = true;
            socket.AcceptConnections = true;
            socket.MaxConnections = 512;

            socket.Events.OnClientDisconnected += ClientDisconnected;
            socket.Events.OnPeerApproval += PeerApproval;
            socket.Events.OnSocketStart += SocketStart;
            socket.Events.OnFailedToConnect += FailedToConnect;

            socket.StartSocket(ServerAddress + ":" + ServerPortRoot);
            socket.RegisterRpcListener(this);
        }
开发者ID:RainsSoft,项目名称:MassiveNet,代码行数:20,代码来源:ServerModel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NetState类代码示例发布时间:2022-05-24
下一篇:
C# Generic.List类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap