Example #1
0
 public static GoogleAPI Instance()
 {
     if (_instance is null)
     {
         _instance = new GoogleAPI();
     }
     return(_instance);
 }
Example #2
0
        private async Task HandleDiscordOpcode(ByteBuffer arg)
        {
            List <object> obj = new List <object>();

            obj.Add(true);

            int rowNumber = arg.ReadInt();

            string sectionToEdit = $"DSN Hub!H{rowNumber}";

            await GoogleAPI.Instance().MakeRequest(sectionToEdit, obj);
        }
Example #3
0
        private async Task HandleRequestLeague(ByteBuffer arg)
        {
            string discordTag = arg.ReadString();

            string league = GoogleAPI.Instance().GetLeague(discordTag);

            ByteBuffer buff = new ByteBuffer(Opcodes.SMSG_LEAGUE_RESPONSE, league.Length + 4);

            buff.WriteString(league);

            await SendPacketAsync(buff).ConfigureAwait(false);
        }
Example #4
0
        private async Task HandleNewNameOpcode(ByteBuffer arg)
        {
            string discordName = arg.ReadString();
            string newName     = arg.ReadString();

            var googleApi = GoogleAPI.Instance();
            int row       = googleApi.GetRowNumber(discordName);

            if (row != -1)
            {
                string sectionToEdit = $"Player Data!O{row}";

                await googleApi.MakeRequest(sectionToEdit, new List <object>() { newName }).ConfigureAwait(false);
            }
        }
Example #5
0
        private async Task HandleDSNCalculationOpcode(ByteBuffer arg)
        {
            List <object> obj = new List <object>();

            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());
            obj.Add(arg.ReadInt());

            int row = arg.ReadInt();

            obj[3] = $"=IFS(ISBLANK(K{row});;OR(K{row}<20;J{row}<20;I{row}<20);\"Investigate App\";OR(K{row}>=150;J{row}>=200;I{row}>= 350);\"Games Verified\";AND(K{row}<150;J{row}<200;I{row}<350); \"Min Games not reached\")";

            string sectionToEdit = $"DSN Hub!I{row}";

            await GoogleAPI.Instance().MakeRequest(sectionToEdit, obj);
        }
Example #6
0
 public Server()
 {
     _connectedClients = new List <Client>();
     Console.WriteLine($"Created new Server instance");
     GoogleAPI.Instance().Setup().GetAwaiter().GetResult();
 }