2016-11-12 11:33:10 +00:00
|
|
|
|
using Galactic_Colors_Control_Common;
|
|
|
|
|
using Galactic_Colors_Control_Common.Protocol;
|
|
|
|
|
using System.Net.Sockets;
|
2016-11-06 09:59:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Galactic_Colors_Control_Server.Commands
|
|
|
|
|
{
|
|
|
|
|
public class PartyOpenCommand : ICommand
|
|
|
|
|
{
|
|
|
|
|
public string Name { get { return "open"; } }
|
|
|
|
|
public string DescText { get { return "Opens party."; } }
|
2016-11-12 11:33:10 +00:00
|
|
|
|
public string HelpText { get { return "Use 'party open' to open party for join."; } }
|
2016-11-06 09:59:05 +00:00
|
|
|
|
public Manager.CommandGroup Group { get { return Manager.CommandGroup.party; } }
|
|
|
|
|
public bool IsServer { get { return true; } }
|
|
|
|
|
public bool IsClient { get { return true; } }
|
|
|
|
|
public bool IsClientSide { get { return false; } }
|
|
|
|
|
public bool IsNoConnect { get { return false; } }
|
|
|
|
|
public int minArgs { get { return 0; } }
|
|
|
|
|
public int maxArgs { get { return 0; } }
|
|
|
|
|
|
2016-11-12 11:33:10 +00:00
|
|
|
|
public RequestResult Execute(string[] args, Socket soc, bool server = false)
|
2016-11-06 09:59:05 +00:00
|
|
|
|
{
|
|
|
|
|
int partyId = -1;
|
2016-11-16 21:27:28 +00:00
|
|
|
|
if (!Utilities.AccessParty(ref partyId, args, true, soc, server))
|
2016-11-12 11:33:10 +00:00
|
|
|
|
return new RequestResult(ResultTypes.Error, Common.Strings("Access"));
|
|
|
|
|
|
2016-11-20 20:02:51 +00:00
|
|
|
|
if (Server.parties[partyId].open)
|
2016-11-12 11:33:10 +00:00
|
|
|
|
return new RequestResult(ResultTypes.Error, Common.Strings("Allready"));
|
|
|
|
|
|
2016-11-20 20:02:51 +00:00
|
|
|
|
Server.parties[partyId].open = true;
|
2016-11-12 11:33:10 +00:00
|
|
|
|
return new RequestResult(ResultTypes.OK);
|
2016-11-06 09:59:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-11-12 11:33:10 +00:00
|
|
|
|
}
|