// string targetUserID, int informationType, byte[] message, string tag, int fragmentSize internal void Send(string string_0, int int_3, byte[] byte_0, string string_1, int int_4) { BlobAndTagContract contract = new BlobAndTagContract(byte_0, string_1); byte[] buffer = CompactPropertySerializer.Default.Serialize <BlobAndTagContract>(contract); this.method_23(string_0, int_3, buffer, int_4, this.object_0.BlobByRapidEngine); }
private void HandleMessage(IMessageHandler interface37_0) { BinaryInformationContract contract; if ((interface37_0.Header.MessageType == this.object_0.InformationBySend) || (interface37_0.Header.MessageType == this.object_0.InformationByPost)) { contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, contract.InformationType, contract.Content); } else if ((interface37_0.Header.MessageType == this.object_0.BlobInformation) || (interface37_0.Header.MessageType == this.object_0.BlobByRapidEngine)) { BlobFragmentContract contract3 = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0); Information information = this.class76_0.method_1(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract3); if (information != null) { if (interface37_0.Header.MessageType == this.object_0.BlobInformation) { this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, information.InformationType, information.Content); } else if (this.Event_0 != null) { BlobAndTagContract contract4 = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information.Content, 0); this.Event_0(interface37_0.Header.UserID, information.InformationType, contract4.Message, contract4.Tag); } } } else { IHeader interface2; IMessageHandler interface3; if (interface37_0.Header.MessageType == this.object_0.InformationNeedAck) { interface2 = this.interface9_0.imethod_7(interface37_0.Header); interface2.MessageType = this.object_0.Ack; interface3 = this.interface9_0.imethod_2 <Class110>(interface2, null); this.interface40_0.imethod_0(interface3, ActionTypeOnChannelIsBusy.Continue); contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); this.icustomizeHandler_0.HandleInformation(interface37_0.Header.UserID, contract.InformationType, contract.Content); } else if (interface37_0.Header.MessageType == this.object_0.Request) { interface2 = this.interface9_0.imethod_7(interface37_0.Header); interface2.MessageType = this.object_0.Response; contract = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); BinaryInformationContract body = null; try { body = new BinaryInformationContract(this.icustomizeHandler_0.HandleQuery(interface37_0.Header.UserID, contract.InformationType, contract.Content)); } finally { interface3 = this.interface9_0.imethod_2 <BinaryInformationContract>(interface2, body); this.interface40_0.PostMessage(interface3, interface37_0.Header.UserID, ActionTypeOnChannelIsBusy.Continue); } } } }
internal void method_9(string string_1, int int_0, byte[] byte_0, string string_2, int int_1) { if (string_1 == null) { string_1 = "_0"; } BlobAndTagContract contract = new BlobAndTagContract(byte_0, string_2); byte[] buffer = CompactPropertySerializer.Default.Serialize <BlobAndTagContract>(contract); this.method_7(string_1, int_0, buffer, int_1, ChannelMode.P2PChannelFirst, this.customizeMessageTypeRoom_0.BlobByRapidEngine); }
public void BroadcastBlob(string groupID, int broadcastType, byte[] blobContent, string tag, int fragmentSize) { if (fragmentSize <= 0) { throw new ArgumentException("Value of fragmentSize must be greater than 0."); } BlobAndTagContract contract2 = new BlobAndTagContract(blobContent, tag); byte[] src = CompactPropertySerializer.Default.Serialize <BlobAndTagContract>(contract2); int num3 = Interlocked.Increment(ref this.int_0); int num2 = src.Length / fragmentSize; if ((src.Length % fragmentSize) > 0) { num2++; } for (int i = 0; i < num2; i++) { if (!this.interface31_0.Connected.Value) { throw new Exception("The connection to server is interrupted !"); } byte[] dst = null; if (i < (num2 - 1)) { dst = new byte[fragmentSize]; } else { dst = new byte[src.Length - (i * fragmentSize)]; } Buffer.BlockCopy(src, i * fragmentSize, dst, 0, dst.Length); BlobFragmentContract body = new BlobFragmentContract(num3, broadcastType, i, dst, i == (num2 - 1)); IMessageHandler interface2 = this.interface9_0.imethod_4 <BlobFragmentContract>(this.string_0, this.contactsMessageTypeRoom_0.BroadcastBlob, body, groupID); if (!this.interface31_0.imethod_0(interface2, false, ActionTypeOnChannelIsBusy.Continue)) { throw new Exception("The connection to server is interrupted !"); } } }
public IMessageHandler ProcessMessage(IMessageHandler interface37_0) { string str; UserContract contract2; if (interface37_0.Header.MessageType == this.object_0.ContactsConnectedNotify) { contract2 = this.interface9_0.imethod_1 <UserContract>(interface37_0); this.ContactsOutter_0.OnContactsConnected(contract2.UserID); return(null); } if (interface37_0.Header.MessageType == this.object_0.ContactsOfflineNotify) { contract2 = this.interface9_0.imethod_1 <UserContract>(interface37_0); this.ContactsOutter_0.OnContactsOffline(contract2.UserID); return(null); } if (interface37_0.Header.MessageType == this.object_0.BroadcastByServer) { BroadcastContract contract = this.interface9_0.imethod_1 <BroadcastContract>(interface37_0); str = (interface37_0.Header.UserID == "_0") ? null : interface37_0.Header.UserID; this.ContactsOutter_0.OnBroadcastReceived(str, contract.GroupID, contract.InformationType, contract.Content, contract.Tag); return(null); } if (interface37_0.Header.MessageType == this.object_0.BroadcastBlob) { str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID; string destUserID = interface37_0.Header.DestUserID; BlobFragmentContract contract4 = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0); Information information = this.class76_0.method_1(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract4); if (information != null) { BlobAndTagContract contract3 = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information.Content, 0); this.ContactsOutter_0.OnBroadcastReceived(str, destUserID, information.InformationType, contract3.Message, contract3.Tag); } return(null); } return(null); }
public void BroadcastBlob(string groupID, int broadcastType, byte[] blobContent, string tag, int fragmentSize) { if (fragmentSize <= 0) { throw new ArgumentException("Value of fragmentSize must be greater than 0."); } List <string> groupMemberList = this.icontactsManager_0.GetGroupMemberList(groupID); if ((groupMemberList != null) && (groupMemberList.Count != 0)) { BlobAndTagContract contract = new BlobAndTagContract(blobContent, tag); byte[] src = CompactPropertySerializer.Default.Serialize <BlobAndTagContract>(contract); int num2 = Interlocked.Increment(ref this.int_0); int num3 = src.Length / fragmentSize; if ((src.Length % fragmentSize) > 0) { num3++; } for (int i = 0; i < num3; i++) { byte[] dst = null; if (i < (num3 - 1)) { dst = new byte[fragmentSize]; } else { dst = new byte[src.Length - (i * fragmentSize)]; } Buffer.BlockCopy(src, i * fragmentSize, dst, 0, dst.Length); BlobFragmentContract body = new BlobFragmentContract(num2, broadcastType, i, dst, i == (num3 - 1)); IMessageHandler interface2 = this.interface9_0.imethod_4 <BlobFragmentContract>("_0", this.object_0.BroadcastBlob, body, groupID); this.interface40_0.PostMessage(interface2, groupMemberList, ActionTypeOnChannelIsBusy.Continue); } } }
public IMessageHandler ProcessMessage(IMessageHandler interface37_0) { string str; IHeader interface3; IMessageHandler interface4; BinaryInformationContract contract3; if ((interface37_0.Header.MessageType == this.object_0.InformationBySend) || (interface37_0.Header.MessageType == this.object_0.InformationByPost)) { contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID; this.icustomizeHandler_0.HandleInformation(str, contract3.InformationType, contract3.Content); return(null); } if ((interface37_0.Header.MessageType == this.object_0.BlobInformation) || (interface37_0.Header.MessageType == this.object_0.BlobByRapidEngine)) { BlobFragmentContract contract2 = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0); Information information = this.class76_0.method_1(interface37_0.Header.UserID, interface37_0.Header.DestUserID, contract2); if (information != null) { str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID; if (interface37_0.Header.MessageType == this.object_0.BlobInformation) { this.icustomizeHandler_0.HandleInformation(str, information.InformationType, information.Content); } else if (this.Event_0 != null) { BlobAndTagContract contract = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information.Content, 0); this.Event_0(str, information.InformationType, contract.Message, contract.Tag); } } return(null); } if (interface37_0.Header.MessageType == this.object_0.InformationNeedAck) { interface3 = this.interface9_0.imethod_7(interface37_0.Header); interface3.MessageType = this.object_0.Ack; interface4 = this.interface9_0.imethod_2 <Class110>(interface3, null); this.interface31_0.Send(interface4, false, ActionTypeOnChannelIsBusy.Continue); contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID; this.icustomizeHandler_0.HandleInformation(str, contract3.InformationType, contract3.Content); return(null); } if (interface37_0.Header.MessageType == this.object_0.Request) { interface3 = this.interface9_0.imethod_7(interface37_0.Header); interface3.MessageType = this.object_0.Response; contract3 = this.interface9_0.imethod_1 <BinaryInformationContract>(interface37_0); BinaryInformationContract body = null; try { str = NetServer.IsServerUser(interface37_0.Header.UserID) ? null : interface37_0.Header.UserID; body = new BinaryInformationContract(this.icustomizeHandler_0.HandleQuery(str, contract3.InformationType, contract3.Content)); } finally { interface4 = this.interface9_0.imethod_2 <BinaryInformationContract>(interface3, body); this.interface31_0.Send(interface4, true, ActionTypeOnChannelIsBusy.Continue); } return(null); } if (interface37_0.Header.MessageType == this.object_0.GetClientTimeRequest) { interface3 = this.interface9_0.imethod_7(interface37_0.Header); interface3.MessageType = this.object_0.GetClientTimeResponse; ResGetTimeContract contract4 = new ResGetTimeContract(DateTime.Now); return(this.interface9_0.imethod_2 <ResGetTimeContract>(interface3, contract4)); } return(null); }
public IMessageHandler ProcessMessage(IMessageHandler interface37_0) { string destUserID; List <string> groupMemberList; IHeader interface3; if (interface37_0.Header.MessageType == this.object_0.GetContracts) { ReqContactsContract contract4 = this.interface9_0.imethod_1 <ReqContactsContract>(interface37_0); List <string> users = new List <string>(); if (this.icontactsManager_0 != null) { users = this.icontactsManager_0.GetContacts(interface37_0.Header.UserID); if (contract4.JustOnline) { users = this.ginterface8_0.SelectOnlineUserFrom(users); } } ResContactsContract body = new ResContactsContract(users); interface3 = this.interface9_0.imethod_7(interface37_0.Header); return(this.interface9_0.imethod_2 <ResContactsContract>(interface3, body)); } if (interface37_0.Header.MessageType == this.object_0.GetGroupMembers) { GroupContract contract7 = this.interface9_0.imethod_1 <GroupContract>(interface37_0); groupMemberList = this.icontactsManager_0.GetGroupMemberList(contract7.GroupID); GroupmatesContract contract = null; if (groupMemberList != null) { List <string> online = new List <string>(); List <string> offline = new List <string>(); foreach (string str2 in groupMemberList) { if (this.iuserManager_0.IsUserOnLine(str2)) { online.Add(str2); } else { offline.Add(str2); } } contract = new GroupmatesContract(online, offline); } interface3 = this.interface9_0.imethod_7(interface37_0.Header); return(this.interface9_0.imethod_2 <GroupmatesContract>(interface3, contract)); } if (interface37_0.Header.MessageType == this.object_0.BroadcastByServer) { bool flag1 = interface37_0.Header.MessageType == this.object_0.BroadcastByServer; destUserID = interface37_0.Header.DestUserID; BroadcastContract contract2 = this.interface9_0.imethod_1 <BroadcastContract>(interface37_0); if (this.BroadcastReceived != null) { this.BroadcastReceived(interface37_0.Header.UserID, destUserID, contract2.InformationType, contract2.Content, contract2.Tag); } groupMemberList = this.icontactsManager_0.GetGroupMemberList(destUserID); if (groupMemberList != null) { BroadcastInformation information = new BroadcastInformation(interface37_0.Header.UserID, destUserID, contract2.InformationType, contract2.Content, contract2.Tag); foreach (string str3 in groupMemberList) { if (str3 != interface37_0.Header.UserID) { if (this.ginterface8_0.IsUserOnLine(str3)) { this.interface40_0.PostMessage(interface37_0, str3, contract2.ActionTypeOnChannelIsBusy); } else if (this.BroadcastFailed != null) { this.BroadcastFailed(str3, information); } } } } return(null); } if (interface37_0.Header.MessageType == this.object_0.BroadcastBlob) { destUserID = interface37_0.Header.DestUserID; if (this.bool_4 && (this.BroadcastReceived != null)) { BlobFragmentContract contract5 = this.interface9_0.imethod_1 <BlobFragmentContract>(interface37_0); Information information2 = this.class76_0.method_1(interface37_0.Header.UserID, destUserID, contract5); if (information2 != null) { BlobAndTagContract contract6 = CompactPropertySerializer.Default.Deserialize <BlobAndTagContract>(information2.Content, 0); this.BroadcastReceived(interface37_0.Header.UserID, destUserID, contract5.InformationType, contract6.Message, contract6.Tag); } } groupMemberList = this.icontactsManager_0.GetGroupMemberList(destUserID); if (groupMemberList != null) { foreach (string str3 in groupMemberList) { if (str3 != interface37_0.Header.UserID) { this.interface40_0.PostMessage(interface37_0, str3, ActionTypeOnChannelIsBusy.Continue); } } } return(null); } return(null); }