本文整理汇总了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;
}
示例2: Network
public Network()
{
Contexts = new List<WebSocketContext>();
Net = new NetSocket(Log.Reporter);
ReceivedPackets = new List<ReceivedPacket>();
Users = new Dictionary<WebSocketContext, long>();
}
示例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);
}
示例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);
}
}
示例5: Awake
void Awake() {
socket = GetComponent<NetSocket>();
socket.RegisterRpcListener(this);
socket.Events.OnFailedToConnect += ConnectionFailed;
socket.Events.OnConnectedToServer += ConnectedToZone;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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]);
}
}
示例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]);
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}