Jump to content
  • 0

@security Help me


JackTheGorrion

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   14
  • Joined:  04/18/15
  • Last Seen:  

I would like to know if it is possible to fix this security script, since when one reloads the character it removes the @security everything else works very well when it is activated, the problem comes when you close the game or reload the characters or change the @ security........

PD:

 Author:
  - Orce
Review:
 Aly
 Popcorn

Vіr 

screenAzkaban004.jpg

Protection-(EN-US).patch

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 2

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Here is my solution.

All thanks to @Litro Endemic for the idea..

goto pc.cpp

look for 

/*==========================================
 * Invoked once after the char/account/account2 registry variables are received. [Skotlex]
 * We didn't receive item information at this point so DO NOT attempt to do item operations here.
 * See intif_parse_StorageReceived() for item operations [lighta]
 *------------------------------------------*/
void pc_reg_received(struct map_session_data *sd)

Add this :

	// Cash shop
	sd->cashPoints = pc_readaccountreg(sd, add_str(CASHPOINT_VAR));
	sd->kafraPoints = pc_readaccountreg(sd, add_str(KAFRAPOINT_VAR));
	
+	if ( pc_readaccountreg(sd, add_str("#BLOCKPASS")) )
+		sd->state.protection_acc = 1;
+	else
+		sd->state.protection_acc = 0;

Dont include +

 

compile and done.

  • Upvote 3
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

you need to save the value of protection_acc on somewhere (mysql?) so you didn't lost it when log off or changing character. 

on pc.cpp

void pc_setnewpc(struct map_session_data *sd, uint32 account_id, uint32 char_id, int login_id1, t_tick client_tick, int sex, int fd) {

add 


	if( pc_readaccountreg(sd, add_str("#BLOCKPASS")) > 0 )
		sd->state.protection_acc = 1;

after 

	//Required to prevent homunculus copuing a base speed of 0.
	sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED;

 

untested... 

Edited by Litro Endemic
  • Upvote 1
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   2
  • Joined:  01/17/18
  • Last Seen:  

11 hours ago, Litro Endemic said:

you need to save the value of protection_acc on somewhere (mysql?) so you didn't lost it when log off or changing character. 

on pc.cpp


void pc_setnewpc(struct map_session_data *sd, uint32 account_id, uint32 char_id, int login_id1, t_tick client_tick, int sex, int fd) {

add 



	if( pc_readaccountreg(sd, add_str("#BLOCKPASS")) > 0 )
		sd->state.protection_acc = 1;

after 


	//Required to prevent homunculus copuing a base speed of 0.
	sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED;

 

untested... 

i got the next error when try to login the server and reject the session any idea? @Litro Endemic

error.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

it's was showed there "its trying to read what isn't there", well untested code, you can try this one, untested too, but should be ok
in : src/map/pc.cpp

bool pc_authok(struct map_session_data *sd, uint32 login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)

find:

	// Request all registries (auth is considered completed whence they arrive)
	intif_request_registry(sd,7);
	return true;

its where the registry loaded, so after this you can take the state of acc protect from registry

change:

	// Request all registries (auth is considered completed whence they arrive)
	intif_request_registry(sd,7);
	
	if( pc_readaccountreg(sd, add_str("#BLOCKPASS")) > 0 )
		sd->state.protection_acc = 1;
	return true;

 

  • Upvote 1
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   2
  • Joined:  01/17/18
  • Last Seen:  

7 hours ago, Mabuhay said:

Here is my solution.

All thanks to @Litro Endemic for the idea..

goto pc.cpp

look for 


/*==========================================
 * Invoked once after the char/account/account2 registry variables are received. [Skotlex]
 * We didn't receive item information at this point so DO NOT attempt to do item operations here.
 * See intif_parse_StorageReceived() for item operations [lighta]
 *------------------------------------------*/
void pc_reg_received(struct map_session_data *sd)

Add this :


	// Cash shop
	sd->cashPoints = pc_readaccountreg(sd, add_str(CASHPOINT_VAR));
	sd->kafraPoints = pc_readaccountreg(sd, add_str(KAFRAPOINT_VAR));
	
+	if ( pc_readaccountreg(sd, add_str("#BLOCKPASS")) )
+		sd->state.protection_acc = 1;
+	else
+		sd->state.protection_acc = 0;

Dont include +

 

compile and done.

It's working fine thanks for everything @Litro Endemic @Mabuhay

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   14
  • Joined:  04/18/15
  • Last Seen:  

working fine thanks @Litro Endemic @Mabuhay

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...