These are chat archives for ikkentim/SampSharp

7th
Jul 2015
Dean Day
@Bravo-81
Jul 07 2015 14:35
Hey! I'm in the process of setting up my Project using your tutorial. The line where it says inherit the BaseMode Class. I've not got that? Have I missed a step?
Tim Potze
@ikkentim
Jul 07 2015 14:37
Do you mean you don't know how to inherrit it or can't you find basemode?
Dean Day
@Bravo-81
Jul 07 2015 14:37
I can't find it.
Tim Potze
@ikkentim
Jul 07 2015 14:37
BaseMode is in the SampSharp.GameMode namespace
So full id is SampSharp.GameMode.BaseMode
if you can't find it still you're missing a reference to the SampSharp.GameMode library
Dean Day
@Bravo-81
Jul 07 2015 14:39
Here's an SS of my Solution.. http://puu.sh/iQmrz/64cbaaa5b6.png, I'm getting red lines for anything Base related. I've followed every step from your website so far. I think. xD
Tim Potze
@ikkentim
Jul 07 2015 14:39
Could you expand the References?
It should list SampSharp.GameMode
IT does
Florian van Dillen
@fvandillen
Jul 07 2015 14:40
Do you use using SampSharp.GameMode ?
Tim Potze
@ikkentim
Jul 07 2015 14:40
Okay. Add using SampSharp.GameMode; to the top of your file, if you haven’t already
Dean Day
@Bravo-81
Jul 07 2015 14:40
Ah..
Tim Potze
@ikkentim
Jul 07 2015 14:40
damn u beat me to it :)
Florian van Dillen
@fvandillen
Jul 07 2015 14:40
haha
Dean Day
@Bravo-81
Jul 07 2015 14:40
Do I need any of the other using lines that VS puts in by default?
Florian van Dillen
@fvandillen
Jul 07 2015 14:41
In most cases, you don't need to
Dean Day
@Bravo-81
Jul 07 2015 14:41
That fixed it for me, thanks guys. Stupid mistake.
Tim Potze
@ikkentim
Jul 07 2015 14:41
I use resharper it’s the god of every VS user
Florian van Dillen
@fvandillen
Jul 07 2015 14:41
Pro-tip: if you have red lines, you can hover over it and see if Visual Studio suggests importing anything
resharper?
Tim Potze
@ikkentim
Jul 07 2015 14:41
yes
It can do so much for you
I can generate a full consturctor with property setters within a sec
Florian van Dillen
@fvandillen
Jul 07 2015 14:42
sick
Dean Day
@Bravo-81
Jul 07 2015 14:42
To stop people like me re-asking that question. I'd suggest you edit the 'You can now create the entry point of your gamemode. In you project, create a class named GameMode and let it inherit the BaseMode class.' line.. :smile:
Tim Potze
@ikkentim
Jul 07 2015 14:42
Resharper has so many features
Feel free to edit the page :)
Florian van Dillen
@fvandillen
Jul 07 2015 14:42
Or use the ikkentim/sampsharp-boilerplate to set up your project :)
Dean Day
@Bravo-81
Jul 07 2015 14:43
Ohh Github page? This is all new to me.. pretty amazing!
Florian van Dillen
@fvandillen
Jul 07 2015 14:43
Great to have another developer on board
How did you find SampSharp?
Tim Potze
@ikkentim
Jul 07 2015 14:43
Yea well the boiler plate has more steps than the guide so i kinna depricated it
Dean Day
@Bravo-81
Jul 07 2015 14:46
I found it in Tim's signature.
The red logo made me click it, didn't even have a title.
Florian van Dillen
@fvandillen
Jul 07 2015 14:46
Cool :P
I'm working on a presentation-style guide: http://slides.com/florianvandillen/sampsharp#/
Tim Potze
@ikkentim
Jul 07 2015 14:47
I don’t have a red logo in my sig :O
Florian van Dillen
@fvandillen
Jul 07 2015 14:47
I do :P
Sithis is my username
I'm fairly active in the scripting help section, which gives a lot of exposure to the red logo
Tim Potze
@ikkentim
Jul 07 2015 14:47
:)
Dean Day
@Bravo-81
Jul 07 2015 14:47
Ohhh, I found it on your sig then. :P
Florian van Dillen
@fvandillen
Jul 07 2015 14:48
haha
Dean Day
@Bravo-81
Jul 07 2015 14:49
I didn't even see the title..
Tim Potze
@ikkentim
Jul 07 2015 14:49
But @fvandillen about the boilerplate, I’m not sure whether to go ahead with it; I think it might be more complicated than just creating the gamemode from scratch.
That logo was such an artistic inspiration of mine :P
Florian van Dillen
@fvandillen
Jul 07 2015 14:50
It does feature a nice setup with a default controller tho
Tim Potze
@ikkentim
Jul 07 2015 14:50
True
:/
Florian van Dillen
@fvandillen
Jul 07 2015 14:50
Maybe I can incorporate setting up a boilerplate in the tutorial i'm making
Tim Potze
@ikkentim
Jul 07 2015 14:50
I don’t know what to do
All right
Dean Day
@Bravo-81
Jul 07 2015 14:51
Before I move on.. Am I missing another reference?
Tim Potze
@ikkentim
Jul 07 2015 14:51
I’ll remove the depricated tag
Yes
you are missing a reference
Florian van Dillen
@fvandillen
Jul 07 2015 14:51
Yes, SampSharp.GameMode.Controllers
Dean Day
@Bravo-81
Jul 07 2015 14:52
I'll edit that too..
Florian van Dillen
@fvandillen
Jul 07 2015 14:52
Hover over the red line and Visual Studio should suggest including it
Dean Day
@Bravo-81
Jul 07 2015 14:52
It didn't suggest that, but suggested I was missing a reference.
Florian van Dillen
@fvandillen
Jul 07 2015 14:54
It should present you with a little down arrow where you can click on including it
Dean Day
@Bravo-81
Jul 07 2015 14:54
Ah I see, thanks. I'll look out for that.
Florian van Dillen
@fvandillen
Jul 07 2015 14:54
If it doesn't just check the api docs and search for the thing you're trying to use and you'll be able to see which part you should include
Dean Day
@Bravo-81
Jul 07 2015 14:54
Can I ask what this means.. 'gamemode YourGameMode:GameMode'
GameMode is my Class? YourGameMode, what is this referencing?
Florian van Dillen
@fvandillen
Jul 07 2015 14:55
Solution/Assembly name
Dean Day
@Bravo-81
Jul 07 2015 14:55
Mine is 'Team Based Missions' will that be Ok?
Also, do I need to keep the pwn version? 'gamemode0 new 1'
Florian van Dillen
@fvandillen
Jul 07 2015 14:57
my project name is "trinity" and my server config is gamemode trinity:GameMode
I use the empty.pwn as gamemode
Which only has the following code:
main() return;
Dean Day
@Bravo-81
Jul 07 2015 14:59
OK, I have that too.
I've just tried running my first build, the server ran properly but not sure if I'm actually using the game mode I've created/compiled in VS through the turorial?
Florian van Dillen
@fvandillen
Jul 07 2015 15:01
It should tell you if it loaded your gamemode
[18:48:39] Gamemode
[18:48:39] ---------------
[18:48:39] Loading gamemode: trinityRPG:GameMode
[18:48:39] Detected mono version: 3.10.0 (tarball)
[18:48:39] Loaded 9 commands.
[18:48:39] Loaded.
Dean Day
@Bravo-81
Jul 07 2015 15:01
Nope.
Florian van Dillen
@fvandillen
Jul 07 2015 15:01
Did you include the plugin in samp?
Dean Day
@Bravo-81
Jul 07 2015 15:02
In the server config?
Florian van Dillen
@fvandillen
Jul 07 2015 15:02
the sampsharp plugin needs to run or it will not even look for your gamemode
yes
Dean Day
@Bravo-81
Jul 07 2015 15:03
Right, I'm getting somewhere now. That step isn't in the tutorial either, it references another plugin and it's a linux .so file.
Florian van Dillen
@fvandillen
Jul 07 2015 15:03
I have no experience running sampsharp on linux
Dean Day
@Bravo-81
Jul 07 2015 15:03
I'm on Windows, but that's what the server.cfg template has in it.
Tim Potze
@ikkentim
Jul 07 2015 15:04
plugins sampsharp, all you need ;)
It has two lines in the template one for win, one for linux
Dean Day
@Bravo-81
Jul 07 2015 15:04
I'm getting an error about Mono not being installed. So I've downloaded it and extracted it.
Is it a windows exe? Or SAMP plugun
Tim Potze
@ikkentim
Jul 07 2015 15:05
It has two lines in the template one for win, in for linux
Florian van Dillen
@fvandillen
Jul 07 2015 15:05
I just have the mono folder in my samp folder
should do the trick
Dean Day
@Bravo-81
Jul 07 2015 15:05
Boom!
Tim Potze
@ikkentim
Jul 07 2015 15:05
:)
Florian van Dillen
@fvandillen
Jul 07 2015 15:05
Dean Day
@Bravo-81
Jul 07 2015 15:05
So I put Mono into Plugins, not the SAMP Server root.
Tim Potze
@ikkentim
Jul 07 2015 15:05
Yes in the server root
Dean Day
@Bravo-81
Jul 07 2015 15:05
Works now, I get an error. But it's based on my Solution gamemode line.
Florian van Dillen
@fvandillen
Jul 07 2015 15:05
mono dll in the root, mono folder in the root too
Dean Day
@Bravo-81
Jul 07 2015 15:10
OK I get an error loading the gamemode because the library doesn't exist. My line in server.cfg is: gamemode Team Based Missions:GameMode
My solution is Team Based Missions, with the class being GameMode.
Is it because I have spaces?
Florian van Dillen
@fvandillen
Jul 07 2015 15:10
Can you show us the exact error and your folder contents?
Tim Potze
@ikkentim
Jul 07 2015 15:10
Yes
Dean Day
@Bravo-81
Jul 07 2015 15:10
Can I rename the solution without starting again?
Florian van Dillen
@fvandillen
Jul 07 2015 15:10
I tend to avoid spaces there
Tim Potze
@ikkentim
Jul 07 2015 15:10
Yo ucan rename the solution.
In the server.cfg you put EntryNameSpace:EntryClass. sampsharp assumes your gamemode DLL is located in the gamemode folder in your server directory.
It also assumes it’s name is EntryNameSpace.dll
Dean Day
@Bravo-81
Jul 07 2015 15:12
I just renamed my solution, removing the spaces. A rebuild didn't generate new files in my gamemode folder?
Tim Potze
@ikkentim
Jul 07 2015 15:13
RMB on project > Properties > General
I mean RMB on project > Properties > Application
Dean Day
@Bravo-81
Jul 07 2015 15:14
Yup
Tim Potze
@ikkentim
Jul 07 2015 15:14
There are two fields
Assembly name and default namespace
Dean Day
@Bravo-81
Jul 07 2015 15:14
Did that too, I even changed the Default namespace
Tim Potze
@ikkentim
Jul 07 2015 15:14
make sure they’re both the same
And rebuilding didn’t result in new files?
Dean Day
@Bravo-81
Jul 07 2015 15:15
Yes it has
Tim Potze
@ikkentim
Jul 07 2015 15:15
So it works now? :)
Dean Day
@Bravo-81
Jul 07 2015 15:15
I get the same error though with that line.
Tim Potze
@ikkentim
Jul 07 2015 15:16
That’s your gamemodes folder
put it in your gamemode folder
I didn’t want to mess up peoples gamemodes folder with all this stuff
Florian van Dillen
@fvandillen
Jul 07 2015 15:17
Yep, sampsharp needs to compile into gamemode and pawn should be in gamemodes
Tim Potze
@ikkentim
Jul 07 2015 15:18
Here’s what you folder structure should probably look like : http://sampsharp.timpotze.nl/starting-development#folder-structure
Florian van Dillen
@fvandillen
Jul 07 2015 15:18
My gamemode folder: http://i.imgur.com/xB56v2b.jpg
Dean Day
@Bravo-81
Jul 07 2015 15:22
OH
I c..
OK so I moved those files there, I get the same error though. http://puu.sh/iQp2m/3dc19cb7a1.png
Sorry for all the Q's guys, appreciate your help.
Florian van Dillen
@fvandillen
Jul 07 2015 15:23
What's the error exactly?
And no worries, I love to help
Florian van Dillen
@fvandillen
Jul 07 2015 15:23
Can you screenshot your solution explorer?
Florian van Dillen
@fvandillen
Jul 07 2015 15:25
And Project > TeamBasedMissions properties > Tab ' Application ' ?
Tim Potze
@ikkentim
Jul 07 2015 15:25
Can you show your GameMode.cs
I betya it’s something in there
Florian van Dillen
@fvandillen
Jul 07 2015 15:25
Could also be yes
Dean Day
@Bravo-81
Jul 07 2015 15:25
You got it Tim.
I figure that's Tim?
Tim Potze
@ikkentim
Jul 07 2015 15:25
Wrong namespace in there i bet?
yes
Dean Day
@Bravo-81
Jul 07 2015 15:25
Yup.
Tim Potze
@ikkentim
Jul 07 2015 15:25
:+1:
Dean Day
@Bravo-81
Jul 07 2015 15:26
That's because I renamed the solution?
Florian van Dillen
@fvandillen
Jul 07 2015 15:26
lol
nice one
Dean Day
@Bravo-81
Jul 07 2015 15:26
:D
Get in, it loaded.
Florian van Dillen
@fvandillen
Jul 07 2015 15:26
Awesome
Oh, and you'll love to be using log4net, nhibernate and all other .NET libraries the ecosystem offers!
Dean Day
@Bravo-81
Jul 07 2015 15:27
Yeah, first thing I want to do is try and setup MySQL.
Tim Potze
@ikkentim
Jul 07 2015 15:27
log4net? :o: what is it?
:o that is
Florian van Dillen
@fvandillen
Jul 07 2015 15:27
Logging library
supports log levels, different outputs
Dean Day
@Bravo-81
Jul 07 2015 15:28
I do get an error, but it isn't stopping the server. It's about the empty gamemode, fails to convert it to empty.dll
Florian van Dillen
@fvandillen
Jul 07 2015 15:28
Such as consoleappender which is basically WriteLine, but also write to output file
Dean Day
@Bravo-81
Jul 07 2015 15:28
the Symbol File Generation.
Tim Potze
@ikkentim
Jul 07 2015 15:28
what do you have on your symbols line in your server.cfg?
Florian van Dillen
@fvandillen
Jul 07 2015 15:29
Great thing about log4net is that it is class aware
Dean Day
@Bravo-81
Jul 07 2015 15:29
I don't have one.. I couldnt find an example.
Tim Potze
@ikkentim
Jul 07 2015 15:29
Nice
Oh lol
Well hmm can you show me the error?
Tim Potze
@ikkentim
Jul 07 2015 15:31
Are you sure you don’t have a symbols line in your config.cfg? It doesn’t automatically try to load empty.dll
Dean Day
@Bravo-81
Jul 07 2015 15:33
Is it because of the gamemode line?
gamemode0 empty 1
gamemode TeamBasedMissions:GameMode
Oh fs
No you're right, I have got that line. As I copied it in from the template.
Tim Potze
@ikkentim
Jul 07 2015 15:34
Change it to symbols TeamBasedMissions
It’s useful for when you’re debugging.
Dean Day
@Bravo-81
Jul 07 2015 15:34
Why does it load empty as a filterscript?
Tim Potze
@ikkentim
Jul 07 2015 15:34
To fix OnRconCommand
Dean Day
@Bravo-81
Jul 07 2015 15:34
Fails to convert TeamBasedMissions
Tim Potze
@ikkentim
Jul 07 2015 15:35
Do you have a TeamBasedMissions.pdb in your gamemode folder?
Florian van Dillen
@fvandillen
Jul 07 2015 15:35
Tim can you elaborate on the symbols? How can you use them?
Tim Potze
@ikkentim
Jul 07 2015 15:36
When you try to print a stacktrace it will be able to tell you line numbers and file names with a symbols file
This message was deleted
It provides extra information about methods, calls etc.
Florian van Dillen
@fvandillen
Jul 07 2015 15:38
Oh wow
Woild have saved me so much trouble lol
Just symbols gamemodename?
Tim Potze
@ikkentim
Jul 07 2015 15:38
.dll
ah thats why d’Oh!
Dean Day
@Bravo-81
Jul 07 2015 15:39
Doh!
Tim Potze
@ikkentim
Jul 07 2015 15:39
@Bravo-81 it has to be symbols TeamBasedMissions.dll
Dean Day
@Bravo-81
Jul 07 2015 15:39
That worked :P
Tim Potze
@ikkentim
Jul 07 2015 15:39
Ty @fvandillen
Dean Day
@Bravo-81
Jul 07 2015 15:39
OK it would seem I'm running..an empty game mode and error free!
Thank you so much guys.
Florian van Dillen
@fvandillen
Jul 07 2015 15:40
Loool
Tim Potze
@ikkentim
Jul 07 2015 15:40
Just a small note, I sometimes (but rarely) have an issue where the server crashes at startup, and it’s caused by the symbols conversion. I don’t know exactly why it crashes but when it happens just comment out the symbols line from the server.cfg.
Florian van Dillen
@fvandillen
Jul 07 2015 15:41
Dont worry my worst fail was worse
Tim Potze
@ikkentim
Jul 07 2015 15:41
:P
Florian van Dillen
@fvandillen
Jul 07 2015 15:41
i had visual studio compiling to a different folder than my gamemode folder. And I couldnt help but wonder why my changes didnt work
Tim Potze
@ikkentim
Jul 07 2015 15:42
:P
I by the way noticed a lot of language related plugins have been released recently
php, lua and JS
Dean Day
@Bravo-81
Jul 07 2015 15:42
:D
Tim Potze
@ikkentim
Jul 07 2015 15:43
Still I think SampSharp is best, because SampSharp uses C#, a real OO language. PHP, Lua and JS are still, like Pawn, scripting languages.
But anyways that’s just a sidenote :)
Dean Day
@Bravo-81
Jul 07 2015 15:43

OK so these commands, like your example..

[Command("tell")]
public static void TellCommand(Player sender, Player receiver, string message)
{
//..
}

Where would this stuff go in my GameMode Class?
Tim Potze
@ikkentim
Jul 07 2015 15:44
Any class
you pick
Dean Day
@Bravo-81
Jul 07 2015 15:44
Player and Command are red linining. :)
Florian van Dillen
@fvandillen
Jul 07 2015 15:45
I prefer grouping commands into the relevant controllers
Now, when you have a custom player class, you can create non-static commands in here
    public class Player : GtaPlayer
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="T:SampSharp.GameMode.World.GtaPlayer" /> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
        public Player(int id) : base(id)
        {
        }

        [Command(“hello”)]
        public void HelloCommand()
        {
        }
    }
But it’s just whatever you prefer.
The command system is so far the best documented : http://sampsharp.timpotze.nl/command-processor
Dean Day
@Bravo-81
Jul 07 2015 15:48
OK I copied your code, it's still redlining Command?
Tim Potze
@ikkentim
Jul 07 2015 15:48
Yess import it
using SampSharp.GameMode.SAMP.Commands;
Dean Day
@Bravo-81
Jul 07 2015 15:49
.<
Tim Potze
@ikkentim
Jul 07 2015 15:49
Dean Day
@Bravo-81
Jul 07 2015 15:50
OK, awesome so now I have my first command.
Oh .SAMP
Right, well I'm going to leave this here.. :P
Thanks again for your help, I'll be back to it tomorrow!
Tim Potze
@ikkentim
Jul 07 2015 15:50
Note: SampSharp is still in beta, as long as no server is running on it 24/7 without issues it will remain like that.
Dean Day
@Bravo-81
Jul 07 2015 15:51
Fair enough.
Thanks for your work, I'm hoping I can transfer my C# skills to SA-MP. Pawn just boggles me.
Tim Potze
@ikkentim
Jul 07 2015 15:51
As long as it’s in beta, new features/changes might break your code
Just a friendly warning :)
NP
Dean Day
@Bravo-81
Jul 07 2015 15:51
Understandable :P
Do you have a tutorial for MySQL?
Tim Potze
@ikkentim
Jul 07 2015 15:51
Not really , only some example code
But @fvandillen might be able to help while im away
I probably won’t be online after today for +- 3 weeks ;)
Dean Day
@Bravo-81
Jul 07 2015 15:52
NP @fvandillen is my new best friend. I'll be back soon!
Tim Potze
@ikkentim
Jul 07 2015 15:53
Cya!
:wave:
Florian van Dillen
@fvandillen
Jul 07 2015 15:56
Haha i will be happy to assist you
I have a working server with fluent nHibernate
which is .NET ORM for mysql
It is blazing fast and really easy to work with once mapped properly
Dean Day
@Bravo-81
Jul 07 2015 18:56
Hey! Downloaded the mobile app for Gitter. Pretty awesome.
So my next step is to integrate nHibernate..is it hard? :)
I got the app :)
Dean Day
@Bravo-81
Jul 07 2015 19:00
Thanks. Can't view it on my phone..but I'll come back to it. :)
Thanks. Can't view it on my phone..but I'll come back to it. :)
I think the first thing I'll do it make it connect to a mysql db and load settings my table.
Dean Day
@Bravo-81
Jul 07 2015 19:37
OK I'm home! Going to give this a go.
Florian van Dillen
@fvandillen
Jul 07 2015 19:39
Well my focus with nhibernate was completely different.
I use the automated generation of tables in nhibernate
I just give it a database server, user and password and let it figure out the rest
Dean Day
@Bravo-81
Jul 07 2015 19:41
I want to create, read and update data from a MySQL database.
Florian van Dillen
@fvandillen
Jul 07 2015 19:41
Nhibernate does it all, and better than anything else
In my gamemode, i can simply say player.Account.Password = "newpassword"; and then player.Save();
Dean Day
@Bravo-81
Jul 07 2015 19:43
Wow, awesome.
I'll try and stick it on now.
Florian van Dillen
@fvandillen
Jul 07 2015 19:43
nhibernate does EVERYTHING else
You could best just forget any mysql tables you have used before and let nhibernate generate it all
Dean Day
@Bravo-81
Jul 07 2015 19:44
I want to integrate my users with phpbb though.
Florian van Dillen
@fvandillen
Jul 07 2015 19:44
Hmm I suggest creating some kind of API/interface between the two
a shared account system will corrupt your gamemode/ server once phpbb updates stuff
Let both have their own database and setup some custom sharing between the two
Dean Day
@Bravo-81
Jul 07 2015 19:45
Hmm OK, makes sense.
Florian van Dillen
@fvandillen
Jul 07 2015 19:46
But given the fact I know nothing about phpbb, I can only help you set up the gamemode ;)
Dean Day
@Bravo-81
Jul 07 2015 19:46
Should I setup nhibernate via NuGet as I did SampSharp?
Florian van Dillen
@fvandillen
Jul 07 2015 19:46
I did that, yes
I'll setup a new project real quick to demonstrate
Dean Day
@Bravo-81
Jul 07 2015 19:48
Nvm installed.. That was easy.
Back soon..i'll look at the Repo Tim gave me earlier.
Florian van Dillen
@fvandillen
Jul 07 2015 19:58
Did you install Fluent Nhibernate, by the way?
I prefer fluent because the mappings are much easier to do.
Dean Day
@Bravo-81
Jul 07 2015 20:29
I just installed the one on the website?
NHibernate 4.0.3.4000
So I want to make the server connect to the database when it starts. What's the process here? Could you by any chance give me a snippet of yours?
Florian van Dillen
@fvandillen
Jul 07 2015 21:10
If you go into nuget in visual studio (right click project in solution ex
Tim Potze
@ikkentim
Jul 07 2015 21:11
Someone unstarred sampsharp :cry:
Florian van Dillen
@fvandillen
Jul 07 2015 21:11
You can search for nhibernate there
oh noes!
just install the fluent nhibernate package which will also take care of any dependencies
Dean Day
@Bravo-81
Jul 07 2015 21:25
OK it's installed.
Florian van Dillen
@fvandillen
Jul 07 2015 21:31
Awesome! I will help you in the morning, gotta get some sleep
Dean Day
@Bravo-81
Jul 07 2015 21:34
No problemo, cheers.