• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ (Request) [Znote AAC] LiveStream or Cast page for TFS 0.4

Aldo Axel

New Member
Joined
Jul 14, 2014
Messages
70
Reaction score
4
Please the page where the players are casting...
(It would be better if they appeared with outfits)...
For znote aac 1.5 or znote acc master (TFS 0.4 8.6)
thanks...
 
Solution
@Aldo Axel
Do you have the column `cast` or `stream_status` in your players table? Do they get the value 1 when one of your players begin the cast?

PHP:
<?php require_once 'engine/init.php';

$casters = mysql_select_multi("SELECT `name`, `castViewers`, `castDescription` FROM `players` WHERE `online`='1' AND `cast`='1' ORDER BY `castViewers` DESC;");
$total_viewers = 0;
if ($casters !== false && !empty($casters))
    foreach ($casters as $caster)
        $total_viewers += (int)$caster['castViewers'];

include 'layout/overall/header.php'; ?>

<h1>Cast list</h1>
<?php if ($casters !== false && !empty($casters)): ?>
    <p>There are currently <?php echo count($casters); ?> players casting with a total of <?php echo $total_viewers; ?>...
What does the mysql cast table look like? (you can check this in phpmyadmin if you have installed cast system on your otserv).
 
Code:
ALTER TABLE  `players` ADD  `cast` TINYINT NOT NULL DEFAULT  '0',
ADD  `castViewers` INT( 11 ) NOT NULL DEFAULT  '0',
ADD  `castDescription` VARCHAR( 255 ) NOT NULL

I tryied this: [Znote AAC] Live Cast Page
But it does not show the description, it does not show the numbers of people who are watching the cast...
 
The web script looks fine, but could you link me your cast system?
If you add any additional columns to the players table, make sure your cast system adapts to them. (No point adding castViewers to the database if your cast system don't update it).
Also be careful when adding NOT NULL column values. I guess you are unable to create a new characters now since you added that query? Make sure it has a default value, like an empty string.
 
~exe file removed, potential virus~
You can make that when entering a cast, modify the table castViewers, and by the same way that when leaving that cast, modify the castViewers table again, for example:

Code:
 db.query("UPDATE `players` SET `castViewers` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")

or something similar...
 
Last edited by a moderator:
~exe file removed, potential virus~
You can make that when entering a cast, modify the table castViewers, and by the same way that when leaving that cast, modify the castViewers table again, for example:

Code:
 db.query("UPDATE `players` SET `castViewers` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")

or something similar...
I need a link to the source code, not the exe file.
I also did a scan of the exe file and it gave a potential vulnerability, the Trojan.Kazy.
 
@Aldo Axel
Do you have the column `cast` or `stream_status` in your players table? Do they get the value 1 when one of your players begin the cast?

PHP:
<?php require_once 'engine/init.php';

$casters = mysql_select_multi("SELECT `name`, `castViewers`, `castDescription` FROM `players` WHERE `online`='1' AND `cast`='1' ORDER BY `castViewers` DESC;");
$total_viewers = 0;
if ($casters !== false && !empty($casters))
    foreach ($casters as $caster)
        $total_viewers += (int)$caster['castViewers'];

include 'layout/overall/header.php'; ?>

<h1>Cast list</h1>
<?php if ($casters !== false && !empty($casters)): ?>
    <p>There are currently <?php echo count($casters); ?> players casting with a total of <?php echo $total_viewers; ?> viewers.</p>
    <table>
        <tbody>
            <tr class="yellow">
                <th>Name</th>
                <th>Viewers</th>
                <th>Description</th>
            </tr>
            <?php foreach ($casters as $caster): ?>
                <tr>
                    <td><a href="/characterprofile.php?name=<?php echo $caster['name'] ?>"><?php echo $caster['name'] ?></a></td>
                    <td><?php echo $caster['castViewers']; ?></td>
                    <td><?php echo $caster['castDescription']; ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
<?php else: ?>
    <p>There are currently nobody casting on this server.</p>
<?php endif;

include 'layout/overall/footer.php'; ?>
 
Last edited:
Solution
Yes, i have the cast tables in the players, castViewers, castDescription, but still it still appears 0 viewers, when there are players watching the cast, and also still appears blank the description of the cast...
Which file i have to edit from source so that when player entering a cast the castViewers table is updated and its valuation changed? just like castDescription table...

~Sorry bad english :p
~Also thanks for the script c:
 
Back
Top