private void HandleLog(int mode) { SQLiteClass sql = new SQLiteClass(ProgramFilesx86() + "\\DuckClient\\Information.dat"); switch (mode) { case IM_GetIdentity: bw.Write(sql.GetGUID()); break; case IM_GetVersion: bw.Write(sql.GetVersion()); break; case IM_GetMAC: var s = MACFinder.getMacByIp(GetIPAddress()); bw.Write(s); break; case IM_GetHostname: bw.Write(Dns.GetHostName()); break; case IM_RegistrationDone: if (br.ReadString().Equals(sql.GetGUID())) { sql.SetRegistered(true); } break; case IM_NewVersionsCheck: DateTimeVersions dtv = DeserializeXMLFileToObject <DateTimeVersions>(br.ReadString()); if (DateTime.Compare(dtv.ServiceDateTime, sql.GetLastUpdated(SQLiteClass.GET_SERVICE_LIST)) > 0 || DateTime.Compare(dtv.WhitelistDateTime, sql.GetLastUpdated(SQLiteClass.GET_WHITELIST_LIST)) > 0) { IMClient imc = new IMClient(); imc.setConnParams(GetOriginIP(), 25568); imc.SetupConn(); imc.SendSignal(IM_NewVersions, "2"); imc.Disconnect(); } break; case IM_NewVersions: DateTimeVersions dtv1 = DeserializeXMLFileToObject <DateTimeVersions>(br.ReadString()); UpdateStuff(dtv1); break; case IM_NewServiceList: List <ServicesObject> sros = DeserializeXMLFileToObject <List <ServicesObject> >(br.ReadString()); sql.NewServices(sros); break; case IM_NewWhitelists: List <Whitelists> wls = DeserializeXMLFileToObject <List <Whitelists> >(br.ReadString()); sql.NewWhitelists(wls); break; case IM_AddWhiteList: break; case IM_RemoveWhitelist: break; case IM_Debug: Console.WriteLine(br.ReadString()); bw.Write(IM_OK); break; default: break; } bw.Write(IM_OK); }