public void UnHideServerIP() { if (ConnectedServer.GetServerByUIN(NecessaryBaseChannelObject.UIN) != null) { ConnectedServer.GetServerByUIN(NecessaryBaseChannelObject.UIN).HideIP = false; } }
public void CloseServerConnection() { try { MemoryStream memoryStream_ReceivedData = new MemoryStream(byteArray_ReceivedData, 4, byteArray_ReceivedData.Length - 4); ulong ulong_ServerUIN = CommonMethods.ReadUInt64FromStream(memoryStream_ReceivedData); if (ConnectedServer.IsNecesseryUINConnected((ulong)ulong_ServerUIN) == true) { ConnectedServer.GetServerByUIN(ulong_ServerUIN).Disconnect(7); } } catch { } }
public void InitInterconnectionProcess() //called by server { try { MemoryStream memoryStream_ReceivedData = new MemoryStream(byteArray_ReceivedData, 4, byteArray_ReceivedData.Length - 4); ulong ulong_ClientUIN = CommonMethods.ReadUInt64FromStream(memoryStream_ReceivedData); if (ConnectedClient.IsNecesseryUINConnected((ulong)ulong_ClientUIN) == true) { NetworkAction.InterConnectedObjects interConnectedObject_obj = new NetworkAction.InterConnectedObjects(); interConnectedObject_obj.AppliedServerChannel = ConnectedServer.GetServerByUIN(this.NecessaryBaseChannelObject.UIN).GetNecesseryAppliedServerChannelByClientUIN(ulong_ClientUIN); interConnectedObject_obj.AppliedClientChannel = ConnectedClient.GetClientByUIN(ulong_ClientUIN).GetNecesseryAppliedClientChannelByServerUIN(this.NecessaryBaseChannelObject.UIN); interConnectedObject_obj.AppliedClientChannel.InterconnectedObject = interConnectedObject_obj.AppliedServerChannel.ChannelOwner; // если клиент ждал сервера то этот объект InterconnectedObject назначается только здесь! new Thread(new ParameterizedThreadStart(new NetworkAction().ClientInterConnectionProcessReceiveCycle)).Start(interConnectedObject_obj); new Thread(new ParameterizedThreadStart(new NetworkAction().ServerInterConnectionProcessReceiveCycle)).Start(interConnectedObject_obj); CommonNetworkEvents.NewInterConnectionEvent(interConnectedObject_obj.AppliedServerChannel, interConnectedObject_obj.AppliedClientChannel); SendNewInterConnectionEventNotify(interConnectedObject_obj.AppliedServerChannel.ChannelOwner.SystemChannel.BaseChannel, interConnectedObject_obj.AppliedServerChannel.ChannelOwner.UIN); SendNewInterConnectionEventNotify(interConnectedObject_obj.AppliedClientChannel.ChannelOwner.SystemChannel.BaseChannel, interConnectedObject_obj.AppliedClientChannel.ChannelOwner.UIN); } memoryStream_ReceivedData.Close(); } catch { } finally { } }