mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-10 06:24:38 +02:00
Got linkshell creation working.
This commit is contained in:
parent
c3c19c3592
commit
1d3dd99414
10 changed files with 149 additions and 13 deletions
|
@ -23,8 +23,22 @@ namespace FFXIVClassic_World_Server
|
|||
mCurrentWorldGroupsReference = worldGroupList;
|
||||
}
|
||||
|
||||
//Checks if the LS name is in use or banned
|
||||
public int CanCreateLinkshell(string name)
|
||||
{
|
||||
bool nameBanned = Database.LinkshellIsBannedName(name);
|
||||
bool alreadyExists = Database.LinkshellExists(name);
|
||||
|
||||
if (nameBanned)
|
||||
return 2;
|
||||
if (alreadyExists)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Creates a new linkshell and adds it to the list
|
||||
public ulong CreateLinkshell(string name, ushort crest, uint master)
|
||||
public Linkshell CreateLinkshell(string name, ushort crest, uint master)
|
||||
{
|
||||
lock (mGroupLockReference)
|
||||
{
|
||||
|
@ -32,18 +46,19 @@ namespace FFXIVClassic_World_Server
|
|||
if (resultId >= 0)
|
||||
{
|
||||
Linkshell newLs = new Linkshell(resultId, mWorldManager.GetGroupIndex(), name, crest, master, 0xa);
|
||||
|
||||
mLinkshellList.Add(mWorldManager.GetGroupIndex(), newLs);
|
||||
mNameToIdLookup.Add(newLs.name, newLs.groupIndex);
|
||||
mLSIdToIdLookup.Add(newLs.dbId, newLs);
|
||||
mCurrentWorldGroupsReference.Add(mWorldManager.GetGroupIndex(), newLs);
|
||||
mWorldManager.IncrementGroupIndex();
|
||||
|
||||
//Add founder to the LS
|
||||
if (AddMemberToLinkshell(master, newLs.name))
|
||||
{
|
||||
mLinkshellList.Add(mWorldManager.GetGroupIndex(), newLs);
|
||||
mNameToIdLookup.Add(newLs.name, newLs.groupIndex);
|
||||
mLSIdToIdLookup.Add(newLs.dbId, newLs);
|
||||
mCurrentWorldGroupsReference.Add(mWorldManager.GetGroupIndex(), newLs);
|
||||
mWorldManager.IncrementGroupIndex();
|
||||
}
|
||||
AddMemberToLinkshell(master, newLs.name);
|
||||
|
||||
return newLs;
|
||||
}
|
||||
return resultId;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue