Blizzhackers

Return of the Jedi

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Tue Jun 18, 2013 8:02 am


All times are UTC [ DST ]





Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Some D2 project which I've been working on (src)
PostPosted: Sat Jan 15, 2011 1:17 am 
 
BHDev
BHDev
User avatar

Joined: Sun Apr 29, 2007 6:58 pm
struct Log{
   unsigned long size;
   unsigned char *aPacket;
   unsigned long Interval;
   unsigned char pRecv;
   Log *pNext;
};
struct sFile{
   char Path[MAX_PATH];
   char szGame[16];
   char szChar[16];
   char szTime[20];
   unsigned long GameTime;
   unsigned long Size;
   sFile *pNext;
};
struct LInfo{
   char szName[16];
   char szGame[16];
   unsigned long nTick;
};
bool SaveReplay(LInfo *pInfo, Log *pLog, unsigned long Packets)
{
   if(!pInfo || !pInfo->szGame || !pInfo->szName
      || !pLog || !pLog->aPacket)
      return false;

    SYSTEMTIME st;
    GetSystemTime(&st);

   char sz[MAX_PATH] = "";
   char szTime[20] = "";

   sprintf(szTime,"%.2d%.2d%.2d%.2d%.2d%.2d%.2d",st.wMonth,st.wDay,st.wYear,st.wHour,st.wMinute,st.wSecond,st.wMilliseconds);
   sprintf(sz,"%s\\records\\%s.gpl",szPath,szTime);

   FILE *fp = fopen(sz,"wb");
   if(!fp)
      return false;

   //Write the header..
   fwrite(pInfo->szName,16,1,fp);
   fwrite(pInfo->szGame,16,1,fp);
   sprintf(szTime,"%.2d/%.2d/%.2d %.2d:%.2d:%.2d",st.wMonth,st.wDay,st.wYear,st.wHour,st.wMinute,st.wSecond);
   fwrite(szTime,20,1,fp);
   unsigned long GameTime = GetTickCount() - pInfo->nTick;
   fwrite(&GameTime,4,1,fp);

   fwrite(&Packets,4,1,fp);

   //Write the actual content.
   for(Log *lg = pLog; lg; lg = lg->pNext)
   {
      fwrite(&lg->size,4,1,fp);
      fwrite(&lg->Interval,4,1,fp);
      fwrite(lg->aPacket,lg->size,1,fp);
   }

   fclose(fp);
   TerminateLogs();

   return true;
}


That's the formatting for the game files which I've used in this project. Guess it can be simplified hah

Top
 Profile  
 Post subject: Re: Some D2 project which I've been working on (src)
PostPosted: Tue Jun 07, 2011 8:50 pm 
 
Section Leader
Section Leader

Joined: Fri Jul 05, 2002 8:51 pm
Location: /sbin/
Gnarmock, would you mind me including replay abilities in D2BS 2.0?

_________________
D2BS
Programming motherfuckers... DO YOU SPEAK IT?!
I, for one, welcome our new black overlo... I mean, president!
  1. Create signature generator.
  2. ???
  3. Profit!

Top
 Profile  
 Post subject: Re: Some D2 project which I've been working on (src)
PostPosted: Fri Jun 24, 2011 1:46 pm 
 
BHDev
BHDev
User avatar

Joined: Sun Apr 29, 2007 6:58 pm
Gnarmock, would you mind me including replay abilities in D2BS 2.0?


Sorry for the late response but I've been really busy the recent days. Sure you can use anything you think is usefull from the source, in fact I'm glad if someone finds a use for it. :)

Top
 Profile  
 Post subject: Re: Some D2 project which I've been working on (src)
PostPosted: Wed Feb 08, 2012 12:21 am 
 
Moderator
Moderator
User avatar

Joined: Mon Jan 30, 2006 2:29 pm
Location: Barrie, Ontario
bump

Top
 Profile  
 Post subject: Re: D2 Recording src [outdated]
PostPosted: Tue Mar 27, 2012 9:45 pm 
 
User
User
User avatar

Joined: Sun Aug 30, 2009 8:01 pm
Wasn't sure whether I should bother with creating a separate thread for this but I figured the general interest in this forum is quite little anyways, so yeah. Back when this release was posted here in Hacking Development it drew my interest. Out of boredom I decided to do something with it and started working on a linux port a few days ago. It's basically an updated D2TT without the in-game GUI but with support for playing recordings in different clients simultaneously. I was thinking about adding a streaming functionality as well, so that you could stream games of a clientless bot to a Diablo II client, but haven't gotten around to do so yet. Although working on anything Diablo 2 related feels like a waste of time it was pretty fun. Thanks for the release Gnarmock! :)

You can find the tool on github.

Top
 Profile  
 Post subject: Re: D2 Recording src [outdated]
PostPosted: Tue Mar 27, 2012 10:38 pm 
 
User
User

Joined: Wed Nov 02, 2011 10:34 pm
Wasn't sure whether I should bother with creating a separate thread for this but I figured the general interest in this forum is quite little anyways, so yeah. Back when this release was posted here in Hacking Development it drew my interest. Out of boredom I decided to do something with it and started working on a linux port a few days ago. It's basically an updated D2TT without the in-game GUI but with support for playing recordings in different clients simultaneously. I was thinking about adding a streaming functionality as well, so that you could stream games of a clientless bot to a Diablo II client, but haven't gotten around to do so yet. Although working on anything Diablo 2 related feels like a waste of time it was pretty fun. Thanks for the release Gnarmock! :)

You can find the tool on github.


:D

Top
 Profile  
 Post subject: Re: D2 Recording src [outdated]
PostPosted: Wed Mar 28, 2012 6:26 am 
 
D2BS Dev
D2BS Dev
User avatar

Joined: Sun Jun 22, 2008 7:00 pm
so basically you re wrote entire d2 client (aka clientless) then recorded it in d2 format that can be replayed also without the client

basically you remade d2
gg


// i see in the source you use d2 functions for the replay (for obvious reasons)

so would it be possible to use d2 functions in your clientless bot without the gui ?

_________________
d2bot# with kolbot
For live support: irc://irc.synirc.net/d2bs

Top
 Profile  
 Post subject: Re: D2 Recording src [outdated]
PostPosted: Wed Mar 28, 2012 3:15 pm 
 
User
User
User avatar

Joined: Sun Aug 30, 2009 8:01 pm
so basically you re wrote entire d2 client (aka clientless) then recorded it in d2 format that can be replayed also without the client

basically you remade d2
gg


// i see in the source you use d2 functions for the replay (for obvious reasons)

so would it be possible to use d2 functions in your clientless bot without the gui ?

The tool uses the official D2 client to replay recordings, you have to inject it. Also, motoko and nd2tt are two separate projects, however, I've added a plugin that creates recordings that you can replay with nd2tt. You still can't use any D2 functions when writing plugins for motoko, though.

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron