public void CheckWebSession(string username, string key) { if (username == null || key == null) { throw new ArgumentNullException(); } string rip = PrimarySocket.RemoteEndPoint.ToString(); if (!TheServer.Settings.Net_OnlineMode) { if (!IsLocalIP(rip)) { throw new Exception("Connection from '" + rip + "' rejected because its IP is not localhost!"); } SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted **WITHOUT AUTHENTICATION** with username: "******"qtype", "check_key" }, { "username", username }, { "ou_key", key }, { "SType", "voxalia" } }; byte[] response = wb.UploadValues(VoxProgram.GlobalServerAddress, "POST", data); string resp = FileHandler.DefaultEncoding.GetString(response).Trim(' ', '\n', '\r', '\t'); if (resp.StartsWith("ACCEPT=") && resp.EndsWith(";")) { SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted with username: "******"ACCEPT=".Length, resp.Length - 1 - "ACCEPT=".Length); * if (!TheServer.Settings.Net_VerifyIP || IsLocalIP(rip) || rip.Contains(ip)) ||{ || SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted with username: "******"Connection from '" + rip + "' rejected because its IP is not " + ip + " or localhost!"); */ } throw new Exception("Connection from '" + rip + "' rejected because: Failed to verify session (" + resp + ") for sess (" + key + ")"); } }
public void CheckWebSession(string username, string key) { if (username == null || key == null) { throw new ArgumentNullException(); } string rip = PrimarySocket.RemoteEndPoint.ToString(); if (!TheServer.CVars.n_online.ValueB) { if (!IsLocalIP(rip)) { throw new Exception("Connection from '" + rip + "' rejected because its IP is not localhost!"); } SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted **WITHOUT AUTHENTICATION** with username: "******"formtype", "confirm" }, { "username", username }, { "session", key } }; byte[] response = wb.UploadValues(VoxProgram.GlobalServerAddress + "account/microconfirm", "POST", data); string resp = FileHandler.encoding.GetString(response).Trim(' ', '\n', '\r', '\t'); if (resp.StartsWith("ACCEPT=") && resp.EndsWith(";")) { string ip = resp.Substring("ACCEPT=".Length, resp.Length - 1 - "ACCEPT=".Length); if (!TheServer.CVars.n_verifyip.ValueB || IsLocalIP(rip) || rip.Contains(ip)) { SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted with username: "******"Connection from '" + rip + "' rejected because its IP is not " + ip + " or localhost!"); } throw new Exception("Connection from '" + rip + "' rejected because: Failed to verify session!"); } }
public void CheckWebSession(string username, string key) { if (username == null || key == null) { throw new ArgumentNullException(); } string rip = PrimarySocket.RemoteEndPoint.ToString(); if (!TheServer.CVars.n_online.ValueB) { if (!IsLocalIP(rip)) { throw new Exception("Connection from '" + rip + "' rejected because its IP is not localhost!"); } SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted **WITHOUT AUTHENTICATION** with username: "******"formtype"] = "confirm"; data["username"] = username; data["session"] = key; byte[] response = wb.UploadValues(Program.GlobalServerAddress + "account/microconfirm", "POST", data); string resp = FileHandler.encoding.GetString(response).Trim(' ', '\n', '\r', '\t'); if (resp.StartsWith("ACCEPT=") && resp.EndsWith(";")) { string ip = resp.Substring("ACCEPT=".Length, resp.Length - 1 - "ACCEPT=".Length); if (!TheServer.CVars.n_verifyip.ValueB || IsLocalIP(rip) || rip.Contains(ip)) { SysConsole.Output(OutputType.INFO, "Connection from '" + rip + "' accepted with username: "******"Connection from '" + rip + "' rejected because its IP is not " + ip + " or localhost!"); } throw new Exception("Connection from '" + rip + "' rejected because: Failed to verify session!"); } }