|
You last visited: Today at 12:29
Advertisement
[RELEASE]Modified Azure Server by Requi
Discussion on [RELEASE]Modified Azure Server by Requi within the DarkOrbit forum part of the Browsergames category.
07/12/2013, 19:56
|
#1
|
elite*gold: 3570
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
|
[RELEASE]Modified Azure Server by Requi
Here we go:
Commands in the Console:
Code:
Damage: dmg USERID DamageAmount
Ship: ship USERID ShipID
Name: name USERID NewName
Speed: speed USERID SpeedAmount
Kick: kick USERID
Factionchange: fac USERID FactionID
HitPoints - hp USERID HPAmount
Shield - shield USERID SHDAmount
MaxShield - maxshield USERID MaxSHDAmount
Close the Server: exit
If you close the server, the settings,will be lost, because it doesn't get written in the database.
Download Source:

VT:
Not needed in my opinion, because you can see all in the source
Quote:
Originally Posted by chichi011
I had a little chat with Requi today and I decided to post the Settings class I've been using in all my projects, helping me to load program settings at runtime, so I don't have to rebuild the project every time I want to change a small detail.
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
/*
Copyright C 2013 - Barney / chichi011
Do not remove this header !
*/
namespace PandaServer
{
public static partial class Program
{
public static Dictionary<string, dynamic> Settings { get; set; }
public static async Task<Dictionary<string, dynamic>> LoadSettingsAsync()
{
var temp = new Dictionary<string, dynamic>(25);
using (var reader = new StreamReader("server.ini"))
{
string line = "";
while ((line = await reader.ReadLineAsync()) != null)
{
if ((line = line.Trim()) == string.Empty || line.StartsWith("##") || line.StartsWith("'")) continue;
var data = line.Split('=');
if (data[1].StartsWith("^pair("))
temp.Add(data[0], ParsePair(data[1]));
else if (data[1].StartsWith("^tuple("))
temp.Add(data[0], ParseTriple(data[1]));
else
temp.Add(data[0], ParseValue(data[1]));
}
}
return temp;
}
public static dynamic ParseValue(string value)
{
dynamic item;
bool _bool;
int _int;
double _double;
if (!int.TryParse(value, out _int))
if (!bool.TryParse(value, out _bool))
if (!double.TryParse(value, out _double))
item = value;
else item = _double;
else item = _bool;
else item = _int;
return item;
}
static dynamic ParsePair(string expression)
{
var split = expression.Replace("^pair(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]));
}
static dynamic ParseTriple(string expression)
{
var split = expression.Replace("^tuple(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]), ParseValue(split[2]));
}
}
}
How to use this ?
Code:
// In C# code:
hero.DamageManager.LF3_Damage = Program.Settings["hero_LF3_Damage"];
// In Settings File:
## Damage config
' this is a comment
'
hero_LF3_Damage=150
|
I hope, somebody can handle with it and modify it more
Regards,
Requi
|
|
|
07/12/2013, 19:58
|
#2
|
elite*gold: 0
Join Date: Sep 2012
Posts: 166
Received Thanks: 65
|
YOU ARE AWAYSOME(SORRY FOR ENGLİSH)
can you add exe
|
|
|
07/12/2013, 20:00
|
#3
|
elite*gold: 3570
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
|
I made this 1 month ago. But now I share it with you
|
|
|
07/12/2013, 20:04
|
#4
|
elite*gold: 0
Join Date: Sep 2012
Posts: 166
Received Thanks: 65
|
Quote:
Originally Posted by Requi
I made this 1 month ago. But now I share it with you
|
thank you so much
|
|
|
07/12/2013, 20:08
|
#5
|
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
|
I had a little chat with Requi today and I decided to post the Settings class I've been using in all my projects, helping me to load program settings at runtime, so I don't have to rebuild the project every time I want to change a small detail.
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
/*
Copyright C 2013 - Barney / chichi011
Do not remove this header !
*/
namespace PandaServer
{
public static partial class Program
{
public static Dictionary<string, dynamic> Settings { get; set; }
public static async Task<Dictionary<string, dynamic>> LoadSettingsAsync()
{
var temp = new Dictionary<string, dynamic>(25);
using (var reader = new StreamReader("server.ini"))
{
string line = "";
while ((line = await reader.ReadLineAsync()) != null)
{
if ((line = line.Trim()) == string.Empty || line.StartsWith("##") || line.StartsWith("'")) continue;
var data = line.Split('=');
if (data[1].StartsWith("^pair("))
temp.Add(data[0], ParsePair(data[1]));
else if (data[1].StartsWith("^tuple("))
temp.Add(data[0], ParseTriple(data[1]));
else
temp.Add(data[0], ParseValue(data[1]));
}
}
return temp;
}
public static dynamic ParseValue(string value)
{
dynamic item;
bool _bool;
int _int;
double _double;
if (!int.TryParse(value, out _int))
if (!bool.TryParse(value, out _bool))
if (!double.TryParse(value, out _double))
item = value;
else item = _double;
else item = _bool;
else item = _int;
return item;
}
static dynamic ParsePair(string expression)
{
var split = expression.Replace("^pair(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]));
}
static dynamic ParseTriple(string expression)
{
var split = expression.Replace("^tuple(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]), ParseValue(split[2]));
}
}
}
How to use this ?
Code:
// In C# code:
hero.DamageManager.LF3_Damage = Program.Settings["hero_LF3_Damage"];
// In Settings File:
## Damage config
' this is a comment
'
hero_LF3_Damage=150
|
|
|
07/12/2013, 20:32
|
#6
|
elite*gold: 0
Join Date: Jul 2012
Posts: 161
Received Thanks: 126
|
Thanks for the source!
|
|
|
07/12/2013, 22:45
|
#7
|
elite*gold: 3570
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
|
If you want any command, then say it. I'll look, if I can add it
|
|
|
07/12/2013, 22:51
|
#8
|
elite*gold: 0
Join Date: Jun 2011
Posts: 53
Received Thanks: 13
|
Hi, Requi sorry for asking I may be a bit stupid ^^ but it would be nice if you can tell me how to install this.
Thank you and sorry for being stupid.
|
|
|
07/12/2013, 23:01
|
#9
|
elite*gold: 3570
Join Date: Dec 2012
Posts: 13,044
Received Thanks: 8,252
|
Quote:
Originally Posted by remixmakk
Hi, Requi sorry for asking I may be a bit stupid ^^ but it would be nice if you can tell me how to install this.
Thank you and sorry for being stupid. 
|
Tutorials:
Do this with the new .exe
In the bin/debug Folder
|
|
|
07/13/2013, 02:31
|
#10
|
elite*gold: 0
Join Date: Mar 2010
Posts: 103
Received Thanks: 9
|
thank you requi i hope there will be a server soon with shop and so on... anyway it works just fine all and i dont even know much about all this things and still it worked for me .. great tutorial ..
|
|
|
07/13/2013, 08:13
|
#11
|
elite*gold: 46
Join Date: Oct 2010
Posts: 782
Received Thanks: 525
|
Quote:
Originally Posted by chichi011
I had a little chat with Requi today and I decided to post the Settings class I've been using in all my projects, helping me to load program settings at runtime, so I don't have to rebuild the project every time I want to change a small detail.
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
/*
Copyright C 2013 - Barney / chichi011
Do not remove this header !
*/
namespace PandaServer
{
public static partial class Program
{
public static Dictionary<string, dynamic> Settings { get; set; }
public static async Task<Dictionary<string, dynamic>> LoadSettingsAsync()
{
var temp = new Dictionary<string, dynamic>(25);
using (var reader = new StreamReader("server.ini"))
{
string line = "";
while ((line = await reader.ReadLineAsync()) != null)
{
if ((line = line.Trim()) == string.Empty || line.StartsWith("##") || line.StartsWith("'")) continue;
var data = line.Split('=');
if (data[1].StartsWith("^pair("))
temp.Add(data[0], ParsePair(data[1]));
else if (data[1].StartsWith("^tuple("))
temp.Add(data[0], ParseTriple(data[1]));
else
temp.Add(data[0], ParseValue(data[1]));
}
}
return temp;
}
public static dynamic ParseValue(string value)
{
dynamic item;
bool _bool;
int _int;
double _double;
if (!int.TryParse(value, out _int))
if (!bool.TryParse(value, out _bool))
if (!double.TryParse(value, out _double))
item = value;
else item = _double;
else item = _bool;
else item = _int;
return item;
}
static dynamic ParsePair(string expression)
{
var split = expression.Replace("^pair(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]));
}
static dynamic ParseTriple(string expression)
{
var split = expression.Replace("^tuple(", "").Replace(")", "").Split(',');
return Tuple.Create(ParseValue(split[0]), ParseValue(split[1]), ParseValue(split[2]));
}
}
}
How to use this ?
Code:
// In C# code:
hero.DamageManager.LF3_Damage = Program.Settings["hero_LF3_Damage"];
// In Settings File:
## Damage config
' this is a comment
'
hero_LF3_Damage=150
|
I think Reading it from the Database is better then your Way. Cause this Way everyone has the Same dmg...
|
|
|
07/13/2013, 08:57
|
#12
|
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
|
Quote:
Originally Posted by omitma
I think Reading it from the Database is better then your Way. Cause this Way everyone has the Same dmg...
|
The example with "LF-3" was just because that was the only idea I had, but you can modify the maximum range for shooting, the number of bonus boxes on the map and stuff like that.
I wanna see you creating a table in your DB just for server settings. It wouldn't be so efficient
|
|
|
07/13/2013, 09:23
|
#13
|
elite*gold: 0
Join Date: Jan 2011
Posts: 1,462
Received Thanks: 281
|
Quote:
Originally Posted by omitma
I think Reading it from the Database is better then your Way. Cause this Way everyone has the Same dmg...
|
I agree with you ^^
|
|
|
07/13/2013, 10:26
|
#14
|
elite*gold: 46
Join Date: Oct 2010
Posts: 782
Received Thanks: 525
|
Quote:
Originally Posted by chichi011
The example with "LF-3" was just because that was the only idea I had, but you can modify the maximum range for shooting, the number of bonus boxes on the map and stuff like that.
I wanna see you creating a table in your DB just for server settings. It wouldn't be so efficient
|
For Range it wouldnt be efficient but for bonusboxes it would be. And i dont know why you would like to change the atack Range for all Users.Both, dB and your idea should be Used i think.
|
|
|
07/13/2013, 10:27
|
#15
|
elite*gold: 0
Join Date: Dec 2012
Posts: 235
Received Thanks: 123
|
Quote:
Originally Posted by chichi011
The example with "LF-3" was just because that was the only idea I had, but you can modify the maximum range for shooting, the number of bonus boxes on the map and stuff like that.
I wanna see you creating a table in your DB just for server settings. It wouldn't be so efficient
|
I thinks it´s great you could write all these "ranges" into the appconfig and read key per key from there.
(i don´t know about secure by doing this but who cares  )
i´m going to use it because loading from a DB is mostly slower than reading from appconfig ( i think so)
PS: LINQ = "bäh" use Lambda expressions thats coding laguage independed
|
|
|
 |
|
Similar Threads
|
[RELEASE]Skylab Bot by Requi
10/07/2013 - DarkOrbit - 34 Replies
Hey Folks,
I have now finished my Skylab Bot :awesome:
Screen:
http://i.epvpimg.com/yqmhe.png
Download:
Skylab Bot.exe
|
[RELEASE]TechCenter by Requi
08/27/2013 - DarkOrbit - 63 Replies
Hey Folks,
I was a bit bored early in the morning and wanted to learn vor Visual Basic.
I thought:
"Hmm. What could I code?"
Then I get a Idea.
A automatic Tech Upgrader :D
|
[RELEASE]UID/SID Getter by Requi
04/06/2013 - DarkOrbit - 8 Replies
Hey Guys,
as my old thread get closed and I don't know why, I create a new thread, because the files there are deleted (rghost -.-)
Screen:
http://i.epvpimg.com/ZrRbb.png
Download:
UIDSIDGetter.exe
|
[RELEASE]AutoRocket Darkorbit [made by Requi]
08/03/2012 - DarkOrbit - 30 Replies
AutoRocket Darkorbit
Hey Guys,
I started with AutoIt, and wanna show you my first little bit usefull program/tool/bot for DarkOrbit.
When you have a little Ship and not enough places for Extras or Credits for Slot-CPU and you have enough from pressing Space for Rockets! With my new program, you press a Key, when you start Fight and again when the Fight is finished. This program/tool/bot shot automatically Rockets and you just press at start and finish of Fight "F1".
Features:
Press...
|
All times are GMT +1. The time now is 12:31.
|
|