public static void newRecent() { for (int i = 0; i < Main.maxMP; i++) { if (Main.recentIP[i] == Netplay.serverIP.ToString() && Main.recentPort[i] == Netplay.serverPort) { for (int j = i; j < Main.maxMP - 1; j++) { Main.recentIP[j] = Main.recentIP[j + 1]; Main.recentPort[j] = Main.recentPort[j + 1]; Main.recentWorld[j] = Main.recentWorld[j + 1]; } } } for (int k = Main.maxMP - 1; k > 0; k--) { Main.recentIP[k] = Main.recentIP[k - 1]; Main.recentPort[k] = Main.recentPort[k - 1]; Main.recentWorld[k] = Main.recentWorld[k - 1]; } Main.recentIP[0] = Netplay.serverIP.ToString(); Main.recentPort[0] = Netplay.serverPort; Main.recentWorld[0] = Main.worldName; Main.SaveRecent(); }
public static void newRecent() { if (Netplay.Connection.Socket.GetRemoteAddress().Type != AddressType.Tcp) { return; } for (int index1 = 0; index1 < Main.maxMP; ++index1) { if (Main.recentIP[index1].ToLower() == Netplay.ServerIPText.ToLower() && Main.recentPort[index1] == Netplay.ListenPort) { for (int index2 = index1; index2 < Main.maxMP - 1; ++index2) { Main.recentIP[index2] = Main.recentIP[index2 + 1]; Main.recentPort[index2] = Main.recentPort[index2 + 1]; Main.recentWorld[index2] = Main.recentWorld[index2 + 1]; } } } for (int index = Main.maxMP - 1; index > 0; --index) { Main.recentIP[index] = Main.recentIP[index - 1]; Main.recentPort[index] = Main.recentPort[index - 1]; Main.recentWorld[index] = Main.recentWorld[index - 1]; } Main.recentIP[0] = Netplay.ServerIPText; Main.recentPort[0] = Netplay.ListenPort; Main.recentWorld[0] = Main.worldName; Main.SaveRecent(); }
public static void AddCurrentServerToRecentList() { if (Connection.Socket.GetRemoteAddress().Type != 0) { return; } for (int i = 0; i < Main.maxMP; i++) { if (Main.recentIP[i].ToLower() == ServerIPText.ToLower() && Main.recentPort[i] == ListenPort) { for (int j = i; j < Main.maxMP - 1; j++) { Main.recentIP[j] = Main.recentIP[j + 1]; Main.recentPort[j] = Main.recentPort[j + 1]; Main.recentWorld[j] = Main.recentWorld[j + 1]; } } } for (int num = Main.maxMP - 1; num > 0; num--) { Main.recentIP[num] = Main.recentIP[num - 1]; Main.recentPort[num] = Main.recentPort[num - 1]; Main.recentWorld[num] = Main.recentWorld[num - 1]; } Main.recentIP[0] = ServerIPText; Main.recentPort[0] = ListenPort; Main.recentWorld[0] = Main.worldName; Main.SaveRecent(); }
public static void newRecent() { if (Netplay.Connection.Socket.GetRemoteAddress().Type != AddressType.Tcp) { return; } for (int i = 0; i < Main.maxMP; i++) { if (Main.recentIP[i].ToLower() == Netplay.ServerIPText.ToLower() && Main.recentPort[i] == Netplay.ListenPort) { for (int j = i; j < Main.maxMP - 1; j++) { Main.recentIP[j] = Main.recentIP[j + 1]; Main.recentPort[j] = Main.recentPort[j + 1]; Main.recentWorld[j] = Main.recentWorld[j + 1]; } } } for (int k = Main.maxMP - 1; k > 0; k--) { Main.recentIP[k] = Main.recentIP[k - 1]; Main.recentPort[k] = Main.recentPort[k - 1]; Main.recentWorld[k] = Main.recentWorld[k - 1]; } Main.recentIP[0] = Netplay.ServerIPText; Main.recentPort[0] = Netplay.ListenPort; Main.recentWorld[0] = Main.worldName; Main.SaveRecent(); }
public static void newRecent() { for (int i = 0; i < Main.maxMP; i++) { if ((Main.recentIP[i] == serverIP.ToString()) && (Main.recentPort[i] == serverPort)) { for (int k = i; k < (Main.maxMP - 1); k++) { Main.recentIP[k] = Main.recentIP[k + 1]; Main.recentPort[k] = Main.recentPort[k + 1]; Main.recentWorld[k] = Main.recentWorld[k + 1]; } } } for (int j = Main.maxMP - 1; j > 0; j--) { Main.recentIP[j] = Main.recentIP[j - 1]; Main.recentPort[j] = Main.recentPort[j - 1]; Main.recentWorld[j] = Main.recentWorld[j - 1]; } Main.recentIP[0] = serverIP.ToString(); Main.recentPort[0] = serverPort; Main.recentWorld[0] = Main.worldName; Main.SaveRecent(); }