mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
My fok marelize
This commit is contained in:
parent
04e12941fb
commit
7e18e8e6fc
@ -269,7 +269,20 @@ public class DChannel
|
||||
* byte length of name of channel/person (dm case)
|
||||
* message-bytes
|
||||
*/
|
||||
msg ~= [cast(byte)1,(cast(byte)sender.getUsername().length)]~cast(byte[])sender.getUsername()~cast(byte[])message;
|
||||
|
||||
/* Set mode to channel message */
|
||||
msg ~= [cast(byte)1];
|
||||
|
||||
/* Encode the [usernameLength, username] */
|
||||
msg ~= [(cast(byte)sender.getUsername().length)];
|
||||
msg ~= cast(byte[])sender.getUsername();
|
||||
|
||||
/* Encode the [channelLength, channel] */
|
||||
msg ~= [(cast(byte)name.length)];
|
||||
msg ~= cast(byte[])name;
|
||||
|
||||
/* Encode the message */
|
||||
msg ~= cast(byte[])message;
|
||||
|
||||
/* Send the message to everyone else in the channel */
|
||||
foreach(DConnection member; members)
|
||||
|
@ -766,7 +766,20 @@ public class DConnection : Thread
|
||||
/* If `delete_user_prop` (requires: authed, client) */
|
||||
else if(command == Command.DELETE_USER_PROP && hasAuthed && connType == ConnectionType.CLIENT)
|
||||
{
|
||||
/* Get the property */
|
||||
string property = cast(string)message.data[1..message.data.length];
|
||||
|
||||
/* Check if the key exists */
|
||||
bool keyExists = isProperty(property);
|
||||
|
||||
/* If the property exists */
|
||||
if(keyExists)
|
||||
{
|
||||
/* Delete the property */
|
||||
deleteProperty(property);
|
||||
}
|
||||
|
||||
reply ~= [keyExists];
|
||||
}
|
||||
/* If `is_user_prop` (requires: authed, client) */
|
||||
else if(command == Command.IS_USER_PROP && hasAuthed && connType == ConnectionType.CLIENT)
|
||||
@ -824,6 +837,7 @@ public class DConnection : Thread
|
||||
private bool authenticate(string username, string password)
|
||||
{
|
||||
/* TODO: Implement me */
|
||||
this.username = username;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user