DarkRift Plugin Sharing Area!

Hmmmm, looks like the authentication issue was due to my password being converted to lowercase when read from the config file.:stuck_out_tongue:

Sorry, I didn’t see you edit!

Ah… ConfigReader will make any strings lower case… I hadn’t noticed thought of that before…

I have a “beginner” question.

I have the SQLConnector working on my server. How do I access it from another plugin running on the server? I tried adding it as a reference in the project but that didn’t work. I know this is something simple.

Thanks in advance

Richard M.

Off the top of my head, it should automatically be loaded under DarkRiftServer.database (or something along those lines!)

Another “beginner” question. Is it possible to get access to the methods and variables in another plugin?

For instance say I have some commands defied in Plugin XYZ and I want those same variables/methods to be available in ABC can that be done? If so how?

Thanks in advance

Richard M.

PluginManager.plugins[“”].YourMethod() :slight_smile:

I am lost. I have that following in my code.

Query = "SELECT CharacterGUID, CharacterLocation from Game.Characters where UserID ='1234567';"

DatabaseRow[] Results = DarkRiftServer.database.ExecuteQuery (Query);

Interface.Log ("Records = " + Results.Length);

I see that it works because Interface.log is showing “Record = 1”

But how do I get to the data that has been returned? So that I can set “Location = returned location”

Thanks
Richard M.

It’s just an array of dictionaries where each row of the array is a row in your database. As an example, to access the first row’s “ID” column you’d do

results[0]["ID"]

Thanks Jamie now I get it…

Richard M.

Code from my ServerCommands Plugin. It is just a public bool that can be toggled (like “log” in the tutorial).

public bool getShowData(){
            return ShowData;
        }

Here is the code from another of my plugins.

ShowData = PluginManager.plugins ["ServerCommands"].getShowData ();

there is no getshow after I put in the “.” but I put it in anyway to try it. All I see after get is “GetHashCode”, “GetSubdirrectory” and “GetType”, When I added the getShowData I just get

I have tried changing it to
[“ServerCommands”].getShowData;
[“ServerCommands.getShowData ()”]
[“ServerCommands.getShowData”]
[“”].getShowData;

and a few other combinations … I did add it as a reference but that did nothing. What did I forget this time:sweat_smile:

Richard M.

PluginManager.plugins [“ServerCommands”] will return a Plugin object which doesn’t have the method getShowData only ServerCommands has that, therefore you need to cast it as such

ServerCommands serverCommands = PluginManager.plugins ["ServerCommands"] as ServerCommands

serverCommands.getShowData()

Hello DarkRifters! Im nearly finished in implementing authoritative server side movement with Dark Rift embedded in a unity instance. I am wondering if anyone else has accomplished this?

The reason I am asking is because I want to release my plugin in a bare bones form with the basic unity standard third person controller but I want to make sure im handling everything in an efficient manner.

Just curious if you all send messages for each individual move action or if any of you have gone with the method of the server sending a “snapshot” of all of the current active move actions (i am using the first described method right now but I feel like the latter will be tricky to implement but much more efficient).

Edit - Spelling cause its 445am and im tired

1 Like

Hi! I’m just recently starting with multiplayer stuff in Unity (well maybe around 1-2 weeks), following tutorials and such, and stumbled upon DarkRift and actually think it’s pretty cool. Right now I’m just experimenting and stuff (doing MMOs is the worst thing you can do all by yourself).
Now the thing is, I’ve been having some problems with setting up the server to connect to MySQL by using the plugin, since the server I wanted to use is behind SSH. Didn’t want to, I’m stubborn as hell maybe, but since I wanted to move on with experimentation had to do it the easy way and actually install MySQL on my PC and localhost thing.

I’ve been reading that C# MySQL implementation lacks some of that, connecting through SSH, though I read too that there are some external libraries around (dunno if they’re finished) that do it for you. Because I’ve been 4 hours trying to open a SSH tunnel and accomplished nothing heh (I was actually scared of breaking my webpage on the process). Did open some but didn’t seemed to work, unlike MySQL workbench which works well. Anyway.

Question is. Is there some interest at developing a SSH enabled version of the MySQL Connector plugin? Is it a bad idea? What would it need to be done? (if I can help with something… I could at least try).

Thanks again for this.

Hey! Glad you like DarkRift!

There’s no plans to implement the MySQL connector to work over SSH because unfortunately it’s going to be obsolete with DarkRift 2!

I’ve not tried tunnelling with SSH (I didn’t actually know you could do it!) so I’m afraid I’m probably not much help on that though…

Jamie

Well that’s sad. Hope DR2 has SSH integration then :smile:. Wouldn’t mind about making the change. Actually will embrace it

Speaking of DR2… I know DR2 is still in development, but how different are things going to be? Like, if I continue learning with DR1, will some of that help me out with DR2? Like, the workflow and stuff, the static API vs multi-connections and all that for example.

Anyway keep up the good work!

I’m still not sure about databasing in DarkRift 2, there is support for saving plugin settings but I think I will leave larger databasing up to you. Databases are a big topic and a wrapper will never cover everything!

Things aren’t different in terms of how things work, it’s mainly just API changes. Tag-Subject messages are still used so if you design your game around those they’ll still be applicable! I would definitely recommend learning DarkRift 1 still :slight_smile:

Jamie

1 Like

I don’t think I’m installing the SQL Connector plugin correctly for the embedded server. What is the typeof for the forceLoadPlugins? Is that step even necessary?

Sorry for the delayed response, you absolutely need the typeof. What’s the problem with the installation?

I don’t know what typeof it is. Not really even sure how to work with the connector even if I did get the typeof

typeof takes a class and returns the associated Type object for that class which DarkRift needs to be able to instantiate your plugin or the connector.

Have a look at the Database class in the reference manual and that should give you an idea of what you need to call, you’ll have access to the connector through the DarkRiftServer.database shortcut once it’s loaded :slight_smile: