Advertisement
HR_Shaft

Master Server for phasor 057 for PC

Dec 10th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.45 KB | None | 0 0
  1. --Master Server for phasor 057 for PC (untested) by H® Shaft (doesn't support CE)
  2. --Changes to the new lobby that the server broadcasts to. Also allows you to change the version.
  3.  
  4. default_version = "01.00.10.0621"
  5. version_address = nil
  6. Game = nil
  7.  
  8. function GetRequiredVersion()
  9.     return 10057
  10. end
  11.  
  12. function OnScriptLoad(process)
  13.     local addr1 = nil
  14.     local addr2 = nil
  15.     addr1 = 0x5c34b4
  16.     addr2 = 0x5c3a08
  17.     version_address = 0x5df840
  18.  
  19.     -- phasor's writestring functions are ridiculously bugged (lol)
  20.     writestring(addr1, "s1.master.hosthpc.com")
  21.     writestring(addr2, "s1.ms01.hosthpc.com")
  22.     writestring(version_address, default_version)
  23. end
  24.  
  25. function OnServerCommand(player, command)
  26.     t = getcmdtokencount(command)
  27.     count = #t
  28.     if (count == 0) then return nil end
  29.     if t[1] == "sv_version" then
  30.         local processed = false
  31.         if (count == 2) then
  32.             v = t[2]
  33.             if (v == "1.10" or v == "110" or v == "10") then                           
  34.                 writestring(version_address, "01.00.10.0621")
  35.                 processed = true
  36.                 respond("Broadcasting on version " .. readstring(version_address))
  37.             end
  38.         else
  39.             respond("current version: " .. readstring(version_address))
  40.             respond("valid versions: 110")
  41.         end    
  42.         return not processed
  43.     end
  44. end
  45.  
  46. function writestring(addr, str)
  47.     local l = 0
  48.     for i = 1, #str do
  49.         local c = string.byte(str, i)
  50.         writebyte(addr + i - 1, c)
  51.         l = l + 1
  52.     end
  53.     writebyte(addr + l, 0)
  54. end
  55.  
  56. function OnClientUpdate(player, m_objectId) end
  57. function OnPlayerKill(killer, victim, mode) end
  58. function OnDamageLookup(receiving_obj, causing_obj, tagdata, tagname) end
  59. function OnGameEnd(mode) end
  60. function OnServerChat(player, chattype, message) return 1 end
  61. function OnPlayerSpawn(player, m_objectId) end
  62. function OnScriptUnload() end
  63. function OnNewGame(map) end
  64. function OnTeamDecision(team) return team end
  65. function OnPlayerJoin(player, team) end
  66. function OnPlayerLeave(player, team) end
  67. function OnKillMultiplier(player, multiplier) end
  68. function OnPlayerSpawnEnd(player, m_objectId) end
  69. function OnTeamChange(relevant, player, team, dest_team) return 1 end
  70. function OnWeaponReload(player, weapon) return 1 end
  71. function OnVehicleEject(player, forceEject) return 1 end
  72. function OnWeaponAssignment(player, object, count, tag) end
  73. function OnObjectCreation(m_objectId, player_owner, tag) end
  74. function OnVehicleEntry(relevant, player, vehicleId, vehicle_tag, seat) return 1 end
  75. function OnObjectInteraction(player, m_ObjectId, tagType, tagName) return 1 end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement