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


C# NetSocket类代码示例

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


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


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