joelolopez Posted April 25, 2013 Group: Members Topic Count: 154 Topics Per Day: 0.03 Content Count: 493 Reputation: 46 Joined: 01/24/12 Last Seen: August 25, 2022 Share Posted April 25, 2013 whenever my wizard opponent is running out of potions, he will freeze me with stormgust and run away and waiting for the 10 secs to logout. any solution for this? i need a script that wont allow to logout while his on the pvp. Quote Link to comment Share on other sites More sharing options...
1 Emistry Posted April 26, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted April 26, 2013 @All all solution isnt working ... nowarp mapflag isnt used to prevent logout.... OnPCLogoutEvent only get triggered when the players logout already ... there is no actual way to prevent logout issue....player still can logout with the ultimate "ALT + F4" ...just that the characters might still remain inside the games for awhile before it disappear from your sight. Quote Link to comment Share on other sites More sharing options...
0 Tanlor Posted January 8, 2019 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 50 Reputation: 14 Joined: 07/23/18 Last Seen: January 9, 2023 Share Posted January 8, 2019 (edited) On 4/26/2013 at 12:03 PM, Emistry said: @All all solution isnt working ... nowarp mapflag isnt used to prevent logout.... OnPCLogoutEvent only get triggered when the players logout already ... there is no actual way to prevent logout issue....player still can logout with the ultimate "ALT + F4" ...just that the characters might still remain inside the games for awhile before it disappear from your sight. Nowadays there's any way to prevent the Ultimate Alt+F4? Because people are abusing it from my server. ;/ Like, change the time the char will remain connected in game after Client Close... Edited January 9, 2019 by Tanlor Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted January 9, 2019 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted January 9, 2019 (edited) Quote AnnieRuru: the trick is, if the player is something like battle_config.prevent_logout, then use the autotrade code Emistry: there are no way u could force ppl cant do the alt-f4 thing lol AnnieRuru: if they alt+f4, then run autotrade AnnieRuru: or @afk code Emistry: these should be control by SOP rules Emistry: like auto declare lose if quit from the map using alt-f4 or not through the designated exit. Emistry: etc Emistry: ban/jail/mute if left AnnieRuru: lol this mod is not meant for pvp event .... this is just pure pk AnnieRuru: like I pk you on the field map, you fight back, I losing, I quickly alt+f4 AnnieRuru: if event, already prevented by onpclogoutevent Emistry: if they ever accept some custom idea .... it might work .... Emistry: like.... to summon a soul upon logout.... the remaining player who kill the soul earn the points lol Emistry: auto remove the soul after 1 min.... Emistry: etc AnnieRuru: HAHAHAHA Emistry: or a clone instead. AnnieRuru: nope, doesn't work, when login there is 5 second invulnerable, can use wing of butterfly to escape Emistry: dun care about login Emistry: only the logout AnnieRuru: a clone means, I losing, I alt+f4, a clone continue harass Emistry: upon logout from PK map ... auto summon a clone ..... clone will delete within 10~15 sec....whoever kill it before it deleted, earn the point. AnnieRuru: haha go post it then XD funny idea AnnieRuru: anyway I have at least tried, well now do some other stuff then behind the scene .... in case anyone share the same views and would like to join for discussion lol @AnnieRuru Edited January 9, 2019 by Emistry 1 Quote Link to comment Share on other sites More sharing options...
0 Zell Posted January 9, 2019 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 412 Reputation: 266 Joined: 04/25/12 Last Seen: Saturday at 11:42 PM Share Posted January 9, 2019 (edited) 1 - Add new map_flag: MF_NORAGEQUIT 2 - Add new value to map_session_data: lastpk 3 - Add new configuration in battle/conf.misc with PK_TIMER (time to set sd->lastpk to 0) 4 - In battle.c when player receive damage from other player in a map with this mapflag set sd->lastpk with source damage char_id. 5 - When player who logout with (sd->lastpk) > 0 && map_id2sd(sd->lastpk) is not null (still online), set for this player who last hitted the player who logout the tsd->killedrid = sd->status.char_id this sd (lets call tsd) and execute npc_event( NPCE_KILLLEVENT, tsd). 6 - Now when player A hit player B, until a ms of time, if player B Log out, the player A garants the execution of label OnPcKillEvent. 7 - Don't forget to put Add_timer in battle.c from same line of 3 step to clean the sd->lastpk of a player (gap between damage. If a player does not hit other in time of a x ms there is no reason to give the kill to the other when logout) let me improve the explication, with pseudo code. I don't remember the funcions name cause I'm on office -- battle.c pc_damage()... // Whatever where log player damage if(sd && tsd) { sd->lasthitter= tsd->status.char_id; add_timer( gettick() + 5000, function_timerToCleanLastHitter, sd->bl.id); // After 5 seconds the function will set sd->lasthitter to 0 } -- pc.c or map.c (dont remember from where OnPcLogOut is called, but the funcion of logout) pcmap_logout() { //before OnPcLogoutevent and other stuff if(sd->lasthitter > 0 && get_mapflag(sd->bl.m, MF_NORAGEQUIT) // Player logout and received hit from a player in last 5 seconds { struct map_session_data* tsd = map_ids2sd( sd->lasthitter ); if(tsd != null) { tsd->killedrid = sd->status.char_id; npce_event( map_id2sd( tsd->lasthitter, NPCE_KILLPC); } } } sorry about english and code. Writing without consulting google translate or source code Edited January 9, 2019 by Zell 1 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted January 10, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 10, 2019 ok try 1 more time after some intense browsing src/map/clif.cpp file, this function is the one that's responsible for handling client quit /*========================================== * // line 1839 *------------------------------------------*/ void clif_quitsave(int fd,struct map_session_data *sd) { if (!battle_config.prevent_logout || sd->canlog_tick == 0 || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) map_quit(sd); else if (sd->fd) { //Disassociate session from player (session is deleted after this function was called) //And set a timer to make him quit later. session[sd->fd]->session_data = NULL; sd->fd = 0; add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); } } I have tested in-game that when Player A hitting Player B, and Player B instantly Alt+F4, there is indeed a 10 seconds duration staying in the game add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); so just change 10000, means 10000 mili-seconds into 30000 to let the player stay in-game for 30 seconds of course the prevent_logout also set to 30000 just to be safe 1 Quote Link to comment Share on other sites More sharing options...
0 Zell Posted January 10, 2019 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 412 Reputation: 266 Joined: 04/25/12 Last Seen: Saturday at 11:42 PM Share Posted January 10, 2019 43 minutes ago, AnnieRuru said: ok try 1 more time after some intense browsing src/map/clif.cpp file, this function is the one that's responsible for handling client quit /*========================================== * // line 1839 *------------------------------------------*/ void clif_quitsave(int fd,struct map_session_data *sd) { if (!battle_config.prevent_logout || sd->canlog_tick == 0 || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) map_quit(sd); else if (sd->fd) { //Disassociate session from player (session is deleted after this function was called) //And set a timer to make him quit later. session[sd->fd]->session_data = NULL; sd->fd = 0; add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); } } I have tested in-game that when Player A hitting Player B, and Player B instantly Alt+F4, there is indeed a 10 seconds duration staying in the game add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0); so just change 10000, means 10000 mili-seconds into 30000 to let the player stay in-game for 30 seconds of course the prevent_logout also set to 30000 just to be safe If you set the prevent logout to 30 seconds will this not affect too when player use a skill or hit a monster? . If the player wants to go to character screen after those action will wait 30 seconds 1 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted January 10, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 10, 2019 1 hour ago, Zell said: If you set the prevent logout to 30 seconds will this not affect too when player use a skill or hit a monster? . If the player wants to go to character screen after those action will wait 30 seconds yes, battle_config.prevent_logout when set to 30 seconds, if they are hitting monster also need to wait 30 seconds to return to character screen hmm .... this battle_config.prevent_logout cover too broad ... Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 26, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 6 hours ago Share Posted April 26, 2013 whenever my wizard opponent is running out of potions, he will freeze me with stormgust and run away and waiting for the 10 secs to logout. any solution for this? i need a script that wont allow to logout while his on the pvp. Set a nowarp mapflag on your pvp room. Quote Link to comment Share on other sites More sharing options...
Capuche Posted April 26, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted April 26, 2013 @Pastkie nowarp mapflag won't solve the problem since it's about log out after some time. With just script npc : - script jono -1,{ OnPCLogoutEvent: if( getmapflag( strcharinfo(3),mf_pvp ) && getgmlevel() < 5 ) atcommand "@mute 1 "+ strcharinfo(0); end; } Mute the player for 1 min if he log out in pvp map (don't forget to add a npc to leave the pvp). Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 26, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 6 hours ago Share Posted April 26, 2013 @Pastkie nowarp mapflag won't solve the problem since it's about log out after some time. With just script npc : - script jono -1,{ OnPCLogoutEvent: if( getmapflag( strcharinfo(3),mf_pvp ) && getgmlevel() < 5 ) atcommand "@mute 1 "+ strcharinfo(0); end; } Mute the player for 1 min if he log out in pvp map (don't forget to add a npc to leave the pvp). Haha lol i misunderstood the topic. Quote Link to comment Share on other sites More sharing options...
Question
joelolopez
whenever my wizard opponent is running out of potions, he will freeze me with stormgust and run away and waiting for the 10 secs to logout. any solution for this? i need a script that wont allow to logout while his on the pvp.
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.