Skip to content

Instantly share code, notes, and snippets.

View RestoreMonarchy's full-sized avatar
👑
Restoring Monarchy

Michał Wrona RestoreMonarchy

👑
Restoring Monarchy
View GitHub Profile
@RestoreMonarchy
RestoreMonarchy / Regions.md
Created March 19, 2021 14:46
Region implementation I use for my Unturned plugins

RegionData.cs

using System;
using UnityEngine;

namespace UnturnedStrike.Plugin.Models
{
    public class RegionData
    {
        public char Character { get; set; }
@RestoreMonarchy
RestoreMonarchy / DataStorage.md
Last active March 31, 2021 14:30
Saving data to json file

DataStorage is a simple class I'm using in my plugins to save data in json file

public class DataStorage<T> where T : class
{
    public string DataPath { get; private set; }
    public DataStorage(string dir, string fileName)
    {
        DataPath = Path.Combine(dir, fileName);
    }
@RestoreMonarchy
RestoreMonarchy / SchoolTask_1.cpp
Last active October 19, 2020 09:01
School Task #1 10/19/2020
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
void Fibonaci(int length);
void FillWithRandom100Numbers(int arr[]);
void OrderByDescending(int arr[]);
void Print100Numbers(int arr[]);
@RestoreMonarchy
RestoreMonarchy / ConfigurationCommands.md
Last active April 25, 2020 17:22
Manually registering RocketMod commands

ExamplePlugin.cs

using Example.Commands;
using Rocket.Core;
using Rocket.Core.Plugins;

namespace Example
{
    public class ExamplePlugin : RocketPlugin<ExampleConfiguration>
    {
using RestoreMonarchy.ChallengeRewards.Database;
using RestoreMonarchy.ChallengeRewards.Models;
using Rocket.Unturned.Player;
using SDG.Unturned;
using Steamworks;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using UnityEngine;
@RestoreMonarchy
RestoreMonarchy / hosting.md
Last active November 9, 2019 11:10
Hosting PHP website on Apache2 Debian 9

Introduction

All the next steps where written while being tested on the Linux Debian 9 dedicated server.

Requirements

Install sudo

Before we begin we have to install sudo because we'll need it in the next steps, so let's update and upgrade the operating system with the following commands