Jump to content
  • 0

ChatRoom that retrives all the id on it


hakuren

Question


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

is there any way that a chatroom retrives all the ids of the chatroom

 

i dont know how but i saw it on clif.c

 


void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd)
{
int fd;
int i,t;
 
nullpo_retv(sd);
nullpo_retv(cd);
 
fd = sd->fd;
if (!session_isActive(fd))
return;
t = (int)(cd->owner->type == BL_NPC);
WFIFOHEAD(fd, 8 + (28*(cd->users+t)));
WFIFOW(fd, 0) = 0xdb;
WFIFOW(fd, 2) = 8 + (28*(cd->users+t));
WFIFOL(fd, 4) = cd->bl.id;
 
if(cd->owner->type == BL_NPC){
char name[NAME_LENGTH+1];
char *pos;
strcpy(name, ((struct npc_data *)cd->owner)->name);
pos = strchr(name, '#');
if ( pos != NULL )
*pos = '\0';
WFIFOL(fd, 30) = 1;
WFIFOL(fd, 8) = 0;
memcpy(WFIFOP(fd, 12), name, NAME_LENGTH);
for (i = 0; i < cd->users; i++) {
WFIFOL(fd, 8+(i+1)*28) = 1;
memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd->status.name, NAME_LENGTH);
}
} else
for (i = 0; i < cd->users; i++) {
WFIFOL(fd, 8+i*28) = (i != 0 || cd->owner->type == BL_NPC);
memcpy(WFIFOP(fd, 8+(i+t)*28+4), cd->usersd->status.name, NAME_LENGTH);
}
WFIFOSET(fd, WFIFOW(fd, 2));
}
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

[paste=74qo3zthrrcz]

 

-	script	OnPCJoinChatEvent	-1,{
	pc_getwaitingroomlist $@waitingroomowner;
	dispbottom $@waitingroomcount +"";
//	for ( .@i = 0; .@i < $@waitingroomcount; .@i++ )
//		dispbottom ( .@i +1 )+". "+ rid2name( $@waitingroomaid[.@i] );
	announce rid2name( $@waitingroomaid[$@waitingroomcount -1] )+" has join "+ rid2name( $@waitingroomaid[0] ) +"'s waitingroom", bc_all;
	end;
}
I wrote this based on hercules emulator =/

so try convert it into rathena source code

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

I've it not tested, but try it like this way.

I don't know what you trying out exactly, so I script only an excample. 

map,x,y,0 script Test Room#IPcheck 837,{
end;
OnInt:
waitingroom "Channel Name",20,"Test Room#IPcheck::OnStart",1;
end;

OnStart:
attachrid($@accountid[0]);
end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

 

I've it not tested, but try it like this way.

I don't know what you trying out exactly, so I script only an excample. 

map,x,y,0 script Test Room#IPcheck 837,{
end;
OnInt:
waitingroom "Channel Name",20,"Test Room#IPcheck::OnStart",1;
end;

OnStart:
attachrid($@accountid[0]);
end;
}

what i mean if the player is created chat? how to retrive the account_id?

Edited by hakuren
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

 

ma'am is this can be done if the player creates the chat room?

 

example player 1 creates the chatroom and player 2 join it will say to the player 1 as attachrid($@accountid[0]); dispbottom "player player 2(name) is join to your chatroom?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

LOL NO

that modification only for npc's chatroom

I think your idea needs to do totally in source modification

chat_joinchat inside chat.c function

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

LOL NO

that modification only for npc's chatroom

I think your idea needs to do totally in source modification

chat_joinchat inside chat.c function

but maam is this possible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

[paste=74qo3zthrrcz]

 

-	script	OnPCJoinChatEvent	-1,{
	pc_getwaitingroomlist $@waitingroomowner;
	dispbottom $@waitingroomcount +"";
//	for ( .@i = 0; .@i < $@waitingroomcount; .@i++ )
//		dispbottom ( .@i +1 )+". "+ rid2name( $@waitingroomaid[.@i] );
	announce rid2name( $@waitingroomaid[$@waitingroomcount -1] )+" has join "+ rid2name( $@waitingroomaid[0] ) +"'s waitingroom", bc_all;
	end;
}
I wrote this based on hercules emulator =/

so try convert it into rathena source code

 

 

maam it works now thank you somuch!!!!!!!!!!!!!!!!!!!!!!

Edited by hakuren
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...