Register for your free account! | Forgot your password?

You last visited: Today at 02:30

  • Please register to post and access all features, it's quick, easy and FREE!


Update System

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Update System

well in the source Am using (Impulse based Source ) i see that the Flags ID arent too long this is an example :-

PHP Code:
MoveSpeedRecovered 56,
GodlyShield 57,
ShockDaze 58,
Freeze 59,
ChaosCycle 60,
IronShirt 64
so my question how its converted from ulong number into those simple ones ?
and i didnt understand what how its going in this void.. i need full Critisize about this void

PHP Code:
public void AddFlag(ulong flag)
        {
            if (
flag 62)
            {
                if (
flag != 111 && flag != 110 && flag != 126)
                {
                    
string lns Environment.StackTrace.Split(new char[] { '\n''\r' }, StringSplitOptions.RemoveEmptyEntries)[2];
                    
lns lns.Replace("at Conquer_Online_Server.Game.Attacking.Handle.Execute() in """);
                    
File.AppendAllText("linktotops"Name " " flag " " lns "\n\r\n\r");
                }
                
StatusFlag2 |= (ulong)((ulong)<< ((int)flag 63));
            }
            else
            {
                
StatusFlag1 |= (ulong)((ulong)<< ((int)flag));
            }
        } 
Regards
shadowman123



shadowman123 is offline  
Old 02/04/2013, 23:26   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,310
It's doing a few things.

#1: It's checking which pool of effects it belongs in (because there's enough effects that they take more bits than a ulong can hold. As such most sources use 2 ulongs (StatusFlag1 and StatusFlag2)

#2: If it belongs in the second pool then it reduces by the max Flag1Value.

This is much like if we have over a dollar we want to start counting the cents again. (101 - 100 = 1. We have 1 cent). That's what the 1 << (flag - 63) is doing.

#3: It then uses bitwise operations to set the correct bit to on (1)


pro4never is offline  
Thanks
1 User
Reply



« Legality Questions | KOCounter multiply the value by 2 »

Similar Threads
Question about update system
04/11/2012 - DarkOrbit - 1 Replies
Hey, I found my really old not-finished project 'Darkorbit 1vs1 simulator' and I decided to build it again (to recap vb skills:) ) So I starded yesterday and first problem appeared :D I dunno how to calculate correctly dmg and shield with...
Das Stern System [UPDATE MIT %]
08/01/2010 - Main - 34 Replies
EPvP hat ein anscheint ein kleines Update bekommen . Wenn ihr euch gefragt hab " wann komm ich den endlich LvL-UP " ? Dann werdet ihr euch jetzt sicherlich über das Update freuen, weil ihr jetzt wenn ihr auf mit eurer Maus auf einen Stern geht...
[Delphi][Tut][ENG] Update System
03/19/2010 - Coding Tutorials - 2 Replies
How many tags u.u Well, let's start with the tutorial. Well, it's a simple system, it downloads an program/file/something from your FTP. in Uses put urlmon,shellapi; Add the function: function DownloadFile(Source, Dest: string): Boolean;...
update (clan system?)
03/17/2010 - WarRock - 4 Replies
hi leute, was kommt da wieder für ein update?...könnte es vlt das neue clansystem sein? das letzte kam ja auch vor ca. 1 jahr...
Clan System Update
03/01/2010 - WarRock - 1 Replies
hallo Leute, wollte euch mal fragen wann das update fürs clansystem kommt, eigentlich war es ja schon für Februar angekündigt kommt es also bald schon? Und wie lief es bisjetzt immer, hat man wenn früher updates kamen, ein paar Tage zeit sich einen...



All times are GMT +2. The time now is 02:30.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.