lfnetwork.com mark read register faq members calendar

Thread: question about .net conventions
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-21-2005, 07:40 PM   #1
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
question about .net conventions

in the .net environment, how do you include precompiled object files?

like in unix we have .o files which can be pre compiled and then included in a makefile


but how do you tell a .net soultion to include pre-made .obj files?


the reason i ask this is cause i'm working on a meathod to catch wallhackers/aimbotters etc and it requires C++, and to get that to workin the jk3 library you need to precompile the C++ object then include it in the final build


the anti cheat thing is also probably a good idea to share around with the modders, as long as the source isn't released publicly becase then it will be subject to hacking
stubert is offline   you may: quote & reply,
Old 07-22-2005, 07:31 AM   #2
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
i can make full C++ calls from jk3 source now


\o/
stubert is offline   you may: quote & reply,
Old 07-22-2005, 10:08 AM   #3
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
I've been a bit wary about doing C++ calls in the .dll code because you have to have a method that works with your windows compiler and your linux compiler.

Let us know if you've come up with a method that works for both.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-22-2005, 03:50 PM   #4
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
i have to bulld a static .lib written in C++

the main header for the lib looks like this

Code:
#ifndef CPP_H
#define CPP_H



#ifdef __cplusplus
 extern "C" {
 #endif 

    void test_pp(void);


#ifdef __cplusplus
 }
 #endif 


 #endif

this is included in the buld for cgame and the c++ lib

in cgame i include this in cg_local.h and it's one of the headers in the lib


void test_pp() looks like this in the lib


Code:
#include <stdio.h>
#include <stdlib.h>

#include "CPP.h"

extern "C" void Com_Printf( const char *msg, ... );


extern "C"  void test_pp(void)
{
   Com_Printf("this is a msg from c++!");

}

to create a static lib, in .net go to new project -> win32 project

then in the wizard that comes up click applications settings and check static .lib


then go into proteries of cgame, go to linker->inpuit and add the .lib name to the "additional depenancies" list

you will also need to put it in one of the .lib paths that .net looks for in tools->options->projects->VC++ directories (show directories for library files)



now you'll be able to add a consolecommand call to test_pp() in cgame and see the message written in the C++ modules

this guide also helps to do further stuff

http://www.parashift.com/c++-faq-lit....html#faq-32.6
stubert is offline   you may: quote & reply,
Old 07-22-2005, 04:57 PM   #5
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
btw, bow to me now
stubert is offline   you may: quote & reply,
Old 07-22-2005, 05:06 PM   #6
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Neat, has anyone tried with the Linux compiles yet?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-22-2005, 05:29 PM   #7
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
in linux you just make a .o with GCC and then copy it to your build directory and add it to your makefile
stubert is offline   you may: quote & reply,
Old 07-22-2005, 08:06 PM   #8
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Well, I mean, has anyone actually tested that one with the linux compiling? I'm concerned that it might be unstable.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-23-2005, 01:10 AM   #9
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
it's all the same machine code in the end
stubert is offline   you may: quote & reply,
Old 07-23-2005, 10:56 AM   #10
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
In theory, yes, but this isn't something that .dll support of JKA was designed for. There could be stability issues or maybe slowdown.

I'm just a bit paranoid about these sort of things.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-23-2005, 09:50 PM   #11
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
it still doesn't matter, the dll is stored as assembler no matter what


fear not, all will be well
stubert is offline   you may: quote & reply,
Old 07-24-2005, 05:48 PM   #12
Wudan
Got Balance?
 
Wudan's Avatar
 
Join Date: Oct 2002
Location: Salt Lake, UT
Posts: 1,442
Shouldn't cause any slow-down at all.


Mt-Wudan.com
I made a silly little program called Dragon, which is an animation tool for the GLA format, used in Jedi Outcast, Jedi Academy and Krakatoa.
Wudan is offline   you may: quote & reply,
Old 07-24-2005, 06:28 PM   #13
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
exactly


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-26-2005, 12:02 AM   #14
Wudan
Got Balance?
 
Wudan's Avatar
 
Join Date: Oct 2002
Location: Salt Lake, UT
Posts: 1,442
I am curious though, how much power this gives me - I'm guessing I'd be able to get information about the OpenGL context, and then start pushing polygons to it with this code - isn't that a potential security issue?


Mt-Wudan.com
I made a silly little program called Dragon, which is an animation tool for the GLA format, used in Jedi Outcast, Jedi Academy and Krakatoa.
Wudan is offline   you may: quote & reply,
Old 07-26-2005, 11:18 AM   #15
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
i am setting up a way to use this to query windows for the name of each file in memory and their path

then i'm going to find their md5 sums and check that against a list of know wallhacks and such

but, we still don't have the names of what void functions are in the .exe but i supposse you could find a way to use regular opengl calls



wudan: security issue for who =p
stubert is offline   you may: quote & reply,
Old 07-26-2005, 11:44 AM   #16
CortoCG
 
CortoCG's Avatar
 
Join Date: Jun 2002
Location: Outer Heaven
Posts: 907
A national security issue of utmost importance =P.



Dark Forces Mod: Modeler, animator, coder.

For more detail about my work visit my website
CortoCG is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > question about .net conventions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:18 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.