2019-06-18 22:55:32 -04:00
|
|
|
|
/*
|
|
|
|
|
===========================================================================
|
|
|
|
|
Copyright (C) 2015-2019 Project Meteor Dev Team
|
|
|
|
|
|
|
|
|
|
This file is part of Project Meteor Server.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
|
|
|
|
===========================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
2019-06-19 00:05:18 -04:00
|
|
|
|
using Meteor.Common;
|
2019-06-19 01:10:15 -04:00
|
|
|
|
using Meteor.Map.actors.group.Work;
|
|
|
|
|
using Meteor.Map.dataobjects;
|
|
|
|
|
using Meteor.Map.packets.send.group;
|
|
|
|
|
using Meteor.Map.packets.send.groups;
|
2016-12-21 09:27:51 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2019-06-19 01:10:15 -04:00
|
|
|
|
namespace Meteor.Map.actors.group
|
2016-12-21 09:27:51 -05:00
|
|
|
|
{
|
2017-09-17 15:04:29 -04:00
|
|
|
|
class RelationGroup : Group
|
2016-12-21 09:27:51 -05:00
|
|
|
|
{
|
|
|
|
|
public RelationWork work = new RelationWork();
|
2017-01-29 11:07:28 -05:00
|
|
|
|
private uint charaOther;
|
|
|
|
|
private ulong topicGroup;
|
2016-12-21 09:27:51 -05:00
|
|
|
|
|
2017-09-17 15:04:29 -04:00
|
|
|
|
public RelationGroup(ulong groupIndex, uint host, uint other, uint command, ulong topicGroup) : base (groupIndex)
|
2016-12-21 09:27:51 -05:00
|
|
|
|
{
|
|
|
|
|
this.charaOther = other;
|
|
|
|
|
work._globalTemp.host = ((ulong)host << 32) | (0xc17909);
|
|
|
|
|
work._globalTemp.variableCommand = command;
|
2017-01-29 11:07:28 -05:00
|
|
|
|
this.topicGroup = topicGroup;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public uint GetHost()
|
|
|
|
|
{
|
|
|
|
|
return (uint)(((ulong)work._globalTemp.host >> 32) & 0xFFFFFFFF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public uint GetOther()
|
|
|
|
|
{
|
|
|
|
|
return charaOther;
|
2016-12-21 09:27:51 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetMemberCount()
|
|
|
|
|
{
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override uint GetTypeId()
|
|
|
|
|
{
|
|
|
|
|
return Group.GroupInvitationRelationGroup;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-29 11:07:28 -05:00
|
|
|
|
public ulong GetTopicGroupIndex()
|
2016-12-21 09:27:51 -05:00
|
|
|
|
{
|
2017-01-29 11:07:28 -05:00
|
|
|
|
return topicGroup;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override List<GroupMember> BuildMemberList(uint id)
|
|
|
|
|
{
|
|
|
|
|
List<GroupMember> groupMembers = new List<GroupMember>();
|
|
|
|
|
|
|
|
|
|
uint hostId = (uint)((work._globalTemp.host >> 32) & 0xFFFFFFFF);
|
|
|
|
|
|
|
|
|
|
groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).customDisplayName));
|
|
|
|
|
groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).customDisplayName));
|
|
|
|
|
return groupMembers;
|
2016-12-21 09:27:51 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SendInitWorkValues(Session session)
|
|
|
|
|
{
|
2017-01-29 11:07:28 -05:00
|
|
|
|
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupIndex);
|
|
|
|
|
groupWork.addProperty(this, "work._globalTemp.host");
|
|
|
|
|
groupWork.addProperty(this, "work._globalTemp.variableCommand");
|
|
|
|
|
groupWork.setTarget("/_init");
|
|
|
|
|
|
2017-09-05 12:37:23 -04:00
|
|
|
|
SubPacket test = groupWork.buildPacket(session.id);
|
2017-01-29 11:07:28 -05:00
|
|
|
|
test.DebugPrintSubPacket();
|
2017-06-27 16:55:14 -04:00
|
|
|
|
session.QueuePacket(test);
|
2016-12-21 09:27:51 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|