ArcEmu: [lua] After Pplayer:additem Server Restarts - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Labels

Make sure when posting a help or release topic you put [c++] or [lua] BEFORE your topic title!
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[lua] After Pplayer:additem Server Restarts

#1 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 29 September 2012 - 11:59 AM

When I use this code it works:

function Spell_69412(event, pPlayer, SpellId, pSpellObject)
		
	if ( SpellId == 69412 ) then
		pPlayer:AddItem(34054, 1)	-- Infinite Dust
	end

end

RegisterServerHook(SERVER_HOOK_CAST_SPELL, "Spell_69412")


But when I use a simliar code like that, the server restarts.
Before it prints the player name, means pPlayer is valid.

Why is that ?

function Spell_69412(event, pPlayer, SpellId, pSpellObject)
		
	if ( SpellId == 69412 ) then
		RegisterTimedEvent( "test", 3000, 1, pPlayer)
	end

end

function test(pPlayer)
	print(pPlayer:GetName())
	pPlayer:AddItem(34054, 1)	-- Infinite Dust 
end

RegisterServerHook(SERVER_HOOK_CAST_SPELL, "Spell_69412")

Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#2 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 29 September 2012 - 05:37 PM

Quote

world.exe!Arcemu::Util::ArcemuAssert(bool condition=false) Line 46 + 0x6 bytes C++
world.exe!Object::PushToWorld(MapMgr * mgr=0x1b759018) Line 963 + 0x19 bytes C++
world.exe!ItemInterface::m_AddItem(Item * item=0x1e269528, char ContainerSlot='˙', short slot=27) Line 267 C++
world.exe!ItemInterface::SafeAddItem(Item * pItem=0x1e269528, char ContainerSlot='˙', short slot=27) Line 170 C++
world.exe!ItemInterface::AddItemToFreeSlot(Item * item=0x1e269528) Line 1710 + 0x13 bytes C++
LuaEngine.dll!LuaUnit::AddItem(lua_State * L=0x1e276870, Unit * ptr=0x1e4f9280) Line 935 + 0x20 bytes C++
LuaEngine.dll!LuaEngine::ArcLuna<Unit>::thunk(lua_State * L=0x1e276870) Line 663 + 0x12 bytes C++
LuaEngine.dll!luaD_precall(lua_State * L=0x1e276870, lua_TValue * func=0x1e276410, int nresults=0) Line 319 + 0x16 bytes C
LuaEngine.dll!luaV_execute(lua_State * L=0x1e276870, int nexeccalls=1) Line 587 + 0x14 bytes C
LuaEngine.dll!luaD_call(lua_State * L=0x1e276870, lua_TValue * func=0x1e2763f0, int nResults=0) Line 377 + 0xb bytes C
LuaEngine.dll!f_call(lua_State * L=0x1e276870, void * ud=0x3da2f8f4) Line 800 + 0x16 bytes C
LuaEngine.dll!luaD_rawrunprotected(lua_State * L=0x1e276870, void (lua_State *, void *)* f=0x5fbd8d00, void * ud=0x3da2f8f4) Line 118 + 0x1f bytes C
LuaEngine.dll!luaD_pcall(lua_State * L=0x1e276870, void (lua_State *, void *)* func=0x5fbd8d00, void * u=0x3da2f8f4, int old_top=16, int ef=0) Line 463 + 0x11 bytes C
LuaEngine.dll!lua_pcall(lua_State * L=0x1e276870, int nargs=1, int nresults=0, int errfunc=0) Line 821 + 0x20 bytes C
LuaEngine.dll!LuaEngine::HyperCallFunction(const char * FuncName=0x39c62a20, int ref=2) Line 433 + 0x1d bytes C++
LuaEngine.dll!CallbackP2<LuaEngine,char const *,int>::operator()() Line 153 + 0x2d bytes C++
LuaEngine.dll!CallbackP2<LuaEngine,char const *,int>::execute() Line 154 + 0x16 bytes C++
world.exe!EventableObjectHolder::Update(__int64 time_difference=62) Line 385 + 0x14 bytes C++
world.exe!World::Update(__int64 diff=62) Line 594 C++
world.exe!WorldRunnable::run() Line 72 C++
world.exe!thread_proc(void * param=0x1e2a8430) Line 277 + 0x13 bytes C++



This is why it "restarts". In fact it hits an assert. It's because of the timer you added to it.
It basically tries to add the item from the World thread to the map thread, and that is a problem!
"The demand for free goods is infinite."
0

#3 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 30 September 2012 - 07:44 AM

Damned, I would be happy if I would understand anything of what you are telling me :lol:

And yes, it was an assertion error.

Here's what I wanted to make: http://arcemu.org/fo...showtopic=26573

BTW: How did you produce that error log ? By setting the debug level ?
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#4 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 30 September 2012 - 08:08 AM

View PostMagnifikator, on 30 September 2012 - 07:44 AM, said:

BTW: How did you produce that error log ? By setting the debug level ?

I simply ran Arcemu from Visual Studio and the debugger caught it.
Btw I bet even on your Linux host, a core dump is made when it "restarts". You could get the callstack from that.
"The demand for free goods is infinite."
0

#5 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 30 September 2012 - 08:28 AM

Well, ArcEmu I still have on a Windows server, only the mySQL server and the website is hosted on a Linux Debian server.

But my target is to move everything to Linux.
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users