Xentales

Talk about stuff, and if you must, about Xenimus
It is currently 28 Jun 2017 23:48

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: XPS - Rewrite
PostPosted: 14 Mar 2015 21:20 
Offline

Joined: 05 Nov 2007 11:14
Posts: 107
Currently toying with the idea of rewriting XPS to on the Orleans runtime (in C#), if anyone would be interested in contribooting, hit me up.

The idea I'm toying is writing this as a generic server framework, and having xenlua interpret data sent, proxying it to xenimus, making a server!

If anyone is aware this is technically what the last versions of XPS did, except it was more "heres xenimus data, please forward to client" just so custom things could be added on.

Also considering making this open source :)


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 14 Mar 2015 21:22 
Offline

Joined: 05 Nov 2007 11:14
Posts: 107
To give an example of how orleans works, basically everything is async, heres some samples I've been messing with.

Code:
using Orleans;
using Orleans.Concurrency;
using Orleans.Providers;
using Orleans.Storage;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;

namespace Server
{
    public class AccountData
    {
        public Int64 id = 0;
        public string name = "NOTSET";
        public string password = "NOTSET";
        public float test_float = 1.0f;
    }

    enum AccountFlags
    {
        AccountFlagNone = 0,
        AccountNotValid = 1,
    }

    [Reentrant]
    public class AccountGrain : Grain, IAccountGrain
    {
        AccountData data;
        AccountFlags flags = AccountFlags.AccountFlagNone;

        public override async Task OnActivateAsync()
        {
            IMySQLGrain mysqlres = MySQLGrainFactory.GetGrain(Guid.Empty);

            var accountData = await mysqlres.QueryResultAsList(string.Format("select * from accounts where `name` = '{0}';", this.GetPrimaryKeyString()));

            if (accountData.Count > 0)
                data = MySQLHelper.ToObject<AccountData>(accountData[0]);
            else
                flags |= AccountFlags.AccountNotValid;

            await base.OnActivateAsync();
        }

        public async Task Save()
        {
            if (data == null)
                return;

            var asDictionary = MySQLHelper.ToDictionary(data);
            string query = MySQLHelper.GenerateReplace("accounts", asDictionary, "id"); //don't include id, it's an incrementer in mysql

            return;
        }

        public async Task<AccountCreateResponse> CreateAccount(string password, float test_float)
        {
            if (data != null)
                return AccountCreateResponse.AccountCreateDataAlreadyExists;

            data = new AccountData();
            data.id = 0; //db generates this
            data.name = this.GetPrimaryKeyString();
            data.password = password;
            data.test_float = test_float;

            //validate this account
            flags &= ~AccountFlags.AccountNotValid;

            Save();
            return AccountCreateResponse.AccountCreateOk;
        }

        public async Task<AccountAuthResponse> Authenticate(string password)
        {
            if ((flags & AccountFlags.AccountNotValid) != 0)
                return AccountAuthResponse.AccountAuthNotValid;

            if (password != data.password)
                return AccountAuthResponse.AccountAuthNoMatch;

            return AccountAuthResponse.AccountAuthOk;
        }

    }
}


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 15 Mar 2015 13:33 
Offline
Douchecunt

Joined: 28 Apr 2014 10:23
Posts: 14
This sound interesting, what do you need help with? Is this going to be written for XPS's version or EJ's latest version?

_________________
I am so f- dumb. Kay is the best. I am dumb.


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 15 Mar 2015 22:00 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
If I knew C# and had more free time id help.


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 16 Mar 2015 17:34 
Offline

Joined: 17 Dec 2006 00:18
Posts: 1
Is there currently a Private Xenimus Server at the moment?


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 07 Apr 2015 19:23 
Offline

Joined: 20 Aug 2010 07:00
Posts: 43
77 65 20 6c 6f 76 65 20 79 6f 75 20 61 6e 64 79 21 21 21

=)


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 09 Apr 2015 09:46 
Offline
Douchecunt

Joined: 28 Apr 2014 10:23
Posts: 14
49 20 64 6f 75 62 74 20 74 68 69 73 20 69 73 20 61 63 74 75 61 6c 6c 79 20 67 6f 69 6e 67 20 61 68 65 61 64 20 74 68 6f 75 67 68

_________________
I am so f- dumb. Kay is the best. I am dumb.


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 09 Apr 2015 13:49 
Offline

Joined: 20 Aug 2010 07:00
Posts: 43
dmzo1 wrote:
49 20 64 6f 75 62 74 20 74 68 69 73 20 69 73 20 61 63 74 75 61 6c 6c 79 20 67 6f 69 6e 67 20 61 68 65 61 64 20 74 68 6f 75 67 68

48 61 76 65 20 66 61 69 74 68 2c 20 69 6e 20 61 6e 64 79 20 77 65 20 74 72 75 73 74 21


Top
 Profile  
 
 Post subject: Re: XPS - Rewrite
PostPosted: 27 Jun 2015 22:15 
Offline

Joined: 20 Jun 2013 15:54
Posts: 13
53 6f 2c 20 77 65 27 72 65 20 61 6c 6c 20 74 61 6c 6b 69 6e 67 20 69 6e 20 68 65 78 20 6e 6f 77 3f 20 20 57 68 79 3f


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group