Advertisement
Rochet2

Untitled

Jun 24th, 2015
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. if AIO.AddAddon() then
  2.     local i = 0
  3.     local function MsgOrderTest(player, x)
  4.         if i ~= x then
  5.             print("i~=x: "..tostring(i).." "..tostring(x))
  6.         end
  7.         i = i+1
  8.     end
  9.     AIO.RegisterEvent("MsgOrderTest", MsgOrderTest)
  10.    
  11.     -- test client->server
  12.     for x = 0, 100000 do
  13.         AIO.Msg():Add(x):Send()
  14.     end
  15. else
  16.     local i = 0
  17.     local function MsgOrderTest(player, x)
  18.         if i ~= x then
  19.             error("i~=x: "..tostring(i).." "..tostring(x))
  20.         end
  21.         i = i+1
  22.     end
  23.     AIO.RegisterEvent("MsgOrderTest", MsgOrderTest)
  24.    
  25.     -- test server->client
  26.     local function OnLogin(msg, p)
  27.         p:RegisterEvent(function(_,_,_,player)
  28.             for x = 0, 100000 do
  29.                 AIO.Msg():Add(x):Send(player)
  30.             end
  31.         end, 0, 1)
  32.     end
  33.     AIO.AddOnInit(OnLogin)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement