- -- New Master Server Gamespy Lobby Fix v1.2
- -- for Halo PC/CE for Phasor V2
- -- by Oxide/Urbanyoung/Wizard 5-14-2014
- -- Changes to the new lobby that the server broadcasts to. Also allows you to change the version via console using sv_version command
- -- Phasor Dedi should remain at 1.09, and as of this script, you cannot yet change the version using sv_version command until phasor is patched/updated.
- -- Note: remove sv_version from init file, and/or defaults (if present)
- default_version = "01.00.10.0621"
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(processId, game, persistent)
- if not persistent then
- hprintf("You probably want to load this server persistently when the server starts.")
- hprintf("ie. put it into scripts/persistent and don't load from your init file.")
- end
- local addr1 = nil
- local addr2 = nil
- Game = game
- if (game == "PC") then
- addr1 = 0x5c34b4
- addr2 = 0x5c3a08
- addr3 = 0x5df840
- else
- addr1 = 0x54d384
- addr2 = 0x54d720
- addr3 = 0x564b34
- end
- writestring(addr1, "s1.master.hosthpc.com")
- writestring(addr2, "s1.ms01.hosthpc.com")
- writestring(addr3, default_version)
- end
- function OnServerCommand(admin, command)
- t = tokenizecmdstring(command)
- count = #t
- if t[1] == "sv_version" then
- Command_Version(admin, command, t[2], count)
- return false
- end
- return nil
- end
- function writestring(addr, str)
- local l = 0
- for i = 1, #str do
- local c = string.byte(str, i)
- writebyte(addr + i - 1, c)
- l = l + 1
- end
- writebyte(addr + l, 0)
- end
- function Command_Version(executor, command, version, count)
- if count == 1 then
- sendconsoletext(executor, "The current version is " .. tostring(Version))
- elseif count == 2 and tonumber(version) then
- if Game == "PC" then
- local bool
- if version == "1.00" or version == "00" or version == "0" then
- Version = "01.00.00.0564"
- writestring("01.00.00.0564", 0x5DF840)
- elseif version == "1.01" or version == "01" or version == "1" then
- Version = "01.00.01.0580"
- writestring("01.00.01.0580", 0x5DF840)
- elseif version == "1.02" or version == "02" or version == "2" then
- Version = "01.00.02.0581"
- writestring("01.00.02.0581", 0x5DF840)
- elseif version == "1.03" or version == "03" or version == "3" then
- Version = "01.00.03.0605"
- writestring("01.00.03.0605", 0x5DF840)
- elseif version == "1.04" or version == "04" or version == "4" then
- Version = "01.00.04.0607"
- writestring("01.00.04.0607", 0x5DF840)
- elseif version == "1.05" or version == "05" or version == "5" then
- Version = "01.00.05.0610"
- writestring("01.00.05.0610", 0x5DF840)
- elseif version == "1.06" or version == "06" or version == "6" then
- Version = "01.00.06.0612"
- writestring("01.00.06.0612", 0x5DF840)
- elseif version == "1.07" or version == "07" or version == "7" then
- Version = "01.00.07.0613"
- writestring("01.00.07.0613", 0x5DF840)
- elseif version == "1.08" or version == "08" or version == "8" then
- Version = "01.00.08.0616"
- writestring("01.00.08.0616", 0x5DF840)
- elseif version == "1.09" or version == "09" or version == "9" then
- Version = "01.00.09.0620"
- writestring("01.00.09.0620", 0x5DF840)
- elseif version == "1.10" or version == "10" then
- Version = "01.00.10.0621"
- writestring("01.00.10.0621", 0x5DF840)
- else
- bool = true
- end
- if not bool then
- sendconsoletext(executor, "Server version has been changed to " .. tostring(Version) .. "!")
- else
- sendconsoletext(executor, "That is an invalid server version.")
- end
- elseif tonumber(version) then
- local bool = true
- if version == "1.00" or version == "00" or version == "0" then
- Version = "01.00.00.0609"
- writestring("01.00.00.0609", 0x564B34)
- elseif version == "1.01" or version == "01" or version == "1" then
- Version = "01.00.01.0580"
- writestring("01.00.01.0580", 0x564B34)
- elseif version == "1.02" or version == "02" or version == "2" then
- Version = "01.00.02.0581"
- writestring("01.00.02.0580", 0x564B34)
- elseif version == "1.07" or version == "07" or version == "7" then
- Version = "01.00.07.0613"
- writestring("01.00.07.0613", 0x564B34)
- elseif version == "1.08" or version == "08" or version == "8" then
- Version = "01.00.08.0616"
- writestring("01.00.08.0616", 0x564B34)
- elseif version == "1.09" or version == "09" or version == "9" then
- Version = "01.00.09.0620"
- writestring("01.00.09.0620", 0x564B34)
- elseif version == "1.10" or version == "10" then
- Version = "01.00.10.0621"
- writestring("01.00.10.0621", 0x564B34)
- else
- bool = true
- end
- if not bool then
- sendconsoletext(executor, "Server version has been changed to " .. tostring(Version) .. "!")
- else
- sendconsoletext(executor, "That is an invalid server version.")
- end
- end
- else
- sendconsoletext(executor, "Invalid Syntax: " .. command .. " {version}")
- end
- end
Recent Pastes